summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 23:17:24 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 23:17:24 +0000
commitaa92ba2eee40efbcca4221aa7722946081fa7438 (patch)
treec45f35c042403811923b6761bc464f59e712a5b3 /chrome/service
parenta5353ba87ebffe8689d3a557e55266aae1620280 (diff)
downloadchromium_src-aa92ba2eee40efbcca4221aa7722946081fa7438.zip
chromium_src-aa92ba2eee40efbcca4221aa7722946081fa7438.tar.gz
chromium_src-aa92ba2eee40efbcca4221aa7722946081fa7438.tar.bz2
Revert 50402 (build failure) - Pass in NetLog to NetworkChangeNotifier.
BUG=46822 Review URL: http://codereview.chromium.org/2857009 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/2843017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/net/service_network_change_notifier_thread.cc13
-rw-r--r--chrome/service/net/service_network_change_notifier_thread.h11
-rw-r--r--chrome/service/net/service_network_change_notifier_thread_unittest.cc5
-rw-r--r--chrome/service/service_process.cc3
4 files changed, 15 insertions, 17 deletions
diff --git a/chrome/service/net/service_network_change_notifier_thread.cc b/chrome/service/net/service_network_change_notifier_thread.cc
index 227b2ca..3ccd146 100644
--- a/chrome/service/net/service_network_change_notifier_thread.cc
+++ b/chrome/service/net/service_network_change_notifier_thread.cc
@@ -9,10 +9,8 @@
#include "net/base/network_change_notifier.h"
ServiceNetworkChangeNotifierThread::ServiceNetworkChangeNotifierThread(
- MessageLoop* io_thread_message_loop,
- net::NetLog* net_log)
- : io_thread_message_loop_(io_thread_message_loop),
- net_log_(net_log) {
+ MessageLoop* io_thread_message_loop)
+ : io_thread_message_loop_(io_thread_message_loop) {
DCHECK(io_thread_message_loop_);
}
@@ -36,12 +34,13 @@ MessageLoop* ServiceNetworkChangeNotifierThread::GetMessageLoop() const {
net::NetworkChangeNotifier*
ServiceNetworkChangeNotifierThread::GetNetworkChangeNotifier() const {
- DCHECK_EQ(MessageLoop::current(), io_thread_message_loop_);
+ DCHECK(MessageLoop::current() == io_thread_message_loop_);
return network_change_notifier_.get();
}
void ServiceNetworkChangeNotifierThread::CreateNetworkChangeNotifier() {
- DCHECK_EQ(MessageLoop::current(), io_thread_message_loop_);
+ DCHECK(MessageLoop::current() == io_thread_message_loop_);
network_change_notifier_.reset(
- net::NetworkChangeNotifier::CreateDefaultNetworkChangeNotifier(net_log_));
+ net::NetworkChangeNotifier::CreateDefaultNetworkChangeNotifier());
}
+
diff --git a/chrome/service/net/service_network_change_notifier_thread.h b/chrome/service/net/service_network_change_notifier_thread.h
index cb73f31..14975a6 100644
--- a/chrome/service/net/service_network_change_notifier_thread.h
+++ b/chrome/service/net/service_network_change_notifier_thread.h
@@ -13,7 +13,6 @@
class MessageLoop;
namespace net {
-class NetLog;
class NetworkChangeNotifier;
} // namespace net
@@ -26,9 +25,8 @@ class ServiceNetworkChangeNotifierThread
// Does not take ownership of |io_thread_message_loop|. This instance must
// live no longer than |io_thread_message_loop|.
// TODO(sanjeevr): Change NetworkChangeNotifierThread to use MessageLoopProxy
- ServiceNetworkChangeNotifierThread(
- MessageLoop* io_thread_message_loop,
- net::NetLog* net_log);
+ explicit ServiceNetworkChangeNotifierThread(
+ MessageLoop* io_thread_message_loop);
virtual ~ServiceNetworkChangeNotifierThread();
// Initialize MUST be called before this class can be used.
@@ -41,13 +39,12 @@ class ServiceNetworkChangeNotifierThread
virtual net::NetworkChangeNotifier* GetNetworkChangeNotifier() const;
private:
- void CreateNetworkChangeNotifier();
-
MessageLoop* const io_thread_message_loop_;
- net::NetLog* const net_log_;
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
+ void CreateNetworkChangeNotifier();
DISALLOW_COPY_AND_ASSIGN(ServiceNetworkChangeNotifierThread);
};
#endif // CHROME_SERVICE_NET_SERVICE_NETWORK_CHANGE_NOTIFIER_THREAD_H_
+
diff --git a/chrome/service/net/service_network_change_notifier_thread_unittest.cc b/chrome/service/net/service_network_change_notifier_thread_unittest.cc
index 9cf544a..917d51a 100644
--- a/chrome/service/net/service_network_change_notifier_thread_unittest.cc
+++ b/chrome/service/net/service_network_change_notifier_thread_unittest.cc
@@ -65,7 +65,7 @@ void CheckNullNetworkChangeNotifier(
TEST_F(ServiceNetworkChangeNotifierThreadTest, Basic) {
scoped_refptr<ServiceNetworkChangeNotifierThread> change_notifier_thread =
- new ServiceNetworkChangeNotifierThread(io_thread_.message_loop(), NULL);
+ new ServiceNetworkChangeNotifierThread(io_thread_.message_loop());
EXPECT_EQ(io_thread_.message_loop(),
change_notifier_thread->GetMessageLoop());
change_notifier_thread->Initialize();
@@ -81,7 +81,7 @@ TEST_F(ServiceNetworkChangeNotifierThreadTest, Basic) {
TEST_F(ServiceNetworkChangeNotifierThreadTest, Uninitialized) {
scoped_refptr<ServiceNetworkChangeNotifierThread> change_notifier_thread =
- new ServiceNetworkChangeNotifierThread(io_thread_.message_loop(), NULL);
+ new ServiceNetworkChangeNotifierThread(io_thread_.message_loop());
EXPECT_EQ(io_thread_.message_loop(),
change_notifier_thread->GetMessageLoop());
// We have not called Initialize. Expect the GetNetworkChangeNotifier() call
@@ -97,3 +97,4 @@ TEST_F(ServiceNetworkChangeNotifierThreadTest, Uninitialized) {
}
} // namespace
+
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index a74af52..6e9baf2 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -27,7 +27,7 @@ bool ServiceProcess::Initialize() {
return false;
}
network_change_notifier_thread_ =
- new ServiceNetworkChangeNotifierThread(io_thread_->message_loop(), NULL);
+ new ServiceNetworkChangeNotifierThread(io_thread_->message_loop());
network_change_notifier_thread_->Initialize();
return true;
}
@@ -53,3 +53,4 @@ ServiceProcess::~ServiceProcess() {
DCHECK(cloud_print_proxy_list_.size() == 0);
g_service_process = NULL;
}
+