summaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/base/net_log_event_type_list.h5
-rw-r--r--net/base/net_log_source_type_list.h3
-rw-r--r--net/base/network_change_notifier.cc8
-rw-r--r--net/base/network_change_notifier.h5
-rw-r--r--net/base/network_change_notifier_linux.cc10
-rw-r--r--net/base/network_change_notifier_linux.h6
-rw-r--r--net/base/network_change_notifier_mac.cc10
-rw-r--r--net/base/network_change_notifier_mac.h6
-rw-r--r--net/base/network_change_notifier_win.cc9
-rw-r--r--net/base/network_change_notifier_win.h5
10 files changed, 15 insertions, 52 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index db449d3..d129024 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -567,11 +567,6 @@ EVENT_TYPE(SOCKS5_HANDSHAKE_WRITE)
// The time spent waiting for the response to the CONNECT request.
EVENT_TYPE(SOCKS5_HANDSHAKE_READ)
-// --------------------------------------------------------------------------
-// NetworkChangeNotifier
-// --------------------------------------------------------------------------
-EVENT_TYPE(NETWORK_IP_ADDRESS_CHANGED)
-
// ------------------------------------------------------------------------
// HTTP Authentication
// ------------------------------------------------------------------------
diff --git a/net/base/net_log_source_type_list.h b/net/base/net_log_source_type_list.h
index df60083..6664c2d 100644
--- a/net/base/net_log_source_type_list.h
+++ b/net/base/net_log_source_type_list.h
@@ -13,6 +13,5 @@ SOURCE_TYPE(INIT_PROXY_RESOLVER, 2)
SOURCE_TYPE(CONNECT_JOB, 3)
SOURCE_TYPE(SOCKET, 4)
SOURCE_TYPE(SPDY_SESSION, 5)
-SOURCE_TYPE(NETWORK_CHANGE_NOTIFIER, 6)
-SOURCE_TYPE(COUNT, 7) // Always keep this as the last entry.
+SOURCE_TYPE(COUNT, 6) // Always keep this as the last entry.
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index ebc33b3..aeca2ab 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -16,13 +16,13 @@ namespace net {
// static
NetworkChangeNotifier*
-NetworkChangeNotifier::CreateDefaultNetworkChangeNotifier(NetLog* net_log) {
+NetworkChangeNotifier::CreateDefaultNetworkChangeNotifier() {
#if defined(OS_WIN)
- return new NetworkChangeNotifierWin(net_log);
+ return new NetworkChangeNotifierWin();
#elif defined(OS_LINUX)
- return new NetworkChangeNotifierLinux(net_log);
+ return new NetworkChangeNotifierLinux();
#elif defined(OS_MACOSX)
- return new NetworkChangeNotifierMac(net_log);
+ return new NetworkChangeNotifierMac();
#else
NOTIMPLEMENTED();
return NULL;
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index d15b737..70b195d 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -9,8 +9,6 @@
namespace net {
-class NetLog;
-
// NetworkChangeNotifier monitors the system for network changes, and notifies
// observers on those events.
class NetworkChangeNotifier {
@@ -42,8 +40,7 @@ class NetworkChangeNotifier {
virtual void RemoveObserver(Observer* observer) = 0;
// This will create the platform specific default NetworkChangeNotifier.
- static NetworkChangeNotifier* CreateDefaultNetworkChangeNotifier(
- NetLog* net_log);
+ static NetworkChangeNotifier* CreateDefaultNetworkChangeNotifier();
private:
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc
index e2e2236..9821be5 100644
--- a/net/base/network_change_notifier_linux.cc
+++ b/net/base/network_change_notifier_linux.cc
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "net/base/net_errors.h"
-#include "net/base/net_log.h"
#include "net/base/network_change_notifier_netlink_linux.h"
namespace net {
@@ -23,13 +22,12 @@ const int kInvalidSocket = -1;
} // namespace
-NetworkChangeNotifierLinux::NetworkChangeNotifierLinux(NetLog* net_log)
+NetworkChangeNotifierLinux::NetworkChangeNotifierLinux()
: netlink_fd_(kInvalidSocket),
#if defined(OS_CHROMEOS)
ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)),
#endif
- loop_(MessageLoopForIO::current()),
- net_log_(net_log) {
+ loop_(MessageLoopForIO::current()) {
netlink_fd_ = InitializeNetlinkSocket();
if (netlink_fd_ < 0) {
netlink_fd_ = kInvalidSocket;
@@ -110,10 +108,6 @@ void NetworkChangeNotifierLinux::ListenForNotifications() {
}
void NetworkChangeNotifierLinux::NotifyObserversIPAddressChanged() {
- BoundNetLog net_log =
- BoundNetLog::Make(net_log_, NetLog::SOURCE_NETWORK_CHANGE_NOTIFIER);
- // TODO(willchan): Add the netlink information into an EventParameter.
- net_log.AddEvent(NetLog::TYPE_NETWORK_IP_ADDRESS_CHANGED, NULL);
FOR_EACH_OBSERVER(Observer, observers_, OnIPAddressChanged());
}
diff --git a/net/base/network_change_notifier_linux.h b/net/base/network_change_notifier_linux.h
index 2492dc1..dcedbf4 100644
--- a/net/base/network_change_notifier_linux.h
+++ b/net/base/network_change_notifier_linux.h
@@ -17,15 +17,13 @@
namespace net {
-class NetLog;
-
class NetworkChangeNotifierLinux
: public NetworkChangeNotifier,
public NonThreadSafe,
public MessageLoopForIO::Watcher,
public MessageLoop::DestructionObserver {
public:
- explicit NetworkChangeNotifierLinux(NetLog* net_log);
+ NetworkChangeNotifierLinux();
// NetworkChangeNotifier methods:
virtual void AddObserver(Observer* observer);
@@ -67,8 +65,6 @@ class NetworkChangeNotifierLinux
MessageLoopForIO* loop_;
MessageLoopForIO::FileDescriptorWatcher netlink_watcher_;
- NetLog* const net_log_;
-
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux);
};
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index 40c0808..ba38907 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -31,7 +31,6 @@
#include "base/message_loop.h"
#include "base/scoped_cftyperef.h"
#include "base/thread.h"
-#include "net/base/net_log.h"
namespace net {
@@ -219,10 +218,9 @@ void NetworkChangeNotifierThread::Init() {
} // namespace
-NetworkChangeNotifierMac::NetworkChangeNotifierMac(NetLog* net_log)
+NetworkChangeNotifierMac::NetworkChangeNotifierMac()
: notifier_thread_(NULL),
- method_factory_(this),
- net_log_(net_log) {
+ method_factory_(this) {
// TODO(willchan): Look to see if there's a better signal for when it's ok to
// initialize this, rather than just delaying it by a fixed time.
const int kNotifierThreadInitializationDelayMS = 1000;
@@ -236,10 +234,6 @@ NetworkChangeNotifierMac::NetworkChangeNotifierMac(NetLog* net_log)
void NetworkChangeNotifierMac::OnIPAddressChanged() {
DCHECK(CalledOnValidThread());
- BoundNetLog net_log =
- BoundNetLog::Make(net_log_, NetLog::SOURCE_NETWORK_CHANGE_NOTIFIER);
- // TODO(willchan): Add the network change information into an EventParameter.
- net_log.AddEvent(NetLog::TYPE_NETWORK_IP_ADDRESS_CHANGED, NULL);
FOR_EACH_OBSERVER(Observer, observers_, OnIPAddressChanged());
}
diff --git a/net/base/network_change_notifier_mac.h b/net/base/network_change_notifier_mac.h
index 096b3bd..2ffaaba 100644
--- a/net/base/network_change_notifier_mac.h
+++ b/net/base/network_change_notifier_mac.h
@@ -20,12 +20,10 @@ class Thread;
namespace net {
-class NetLog;
-
class NetworkChangeNotifierMac : public NetworkChangeNotifier,
public NonThreadSafe {
public:
- explicit NetworkChangeNotifierMac(NetLog* net_log);
+ NetworkChangeNotifierMac();
void OnIPAddressChanged();
@@ -54,8 +52,6 @@ class NetworkChangeNotifierMac : public NetworkChangeNotifier,
// Used to initialize the notifier thread.
ScopedRunnableMethodFactory<NetworkChangeNotifierMac> method_factory_;
- NetLog* const net_log_;
-
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac);
};
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index 020e160..bed361c 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -12,7 +12,6 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/object_watcher.h"
-#include "net/base/net_log.h"
namespace net {
@@ -63,16 +62,12 @@ void NetworkChangeNotifierWin::Impl::OnObjectSignaled(HANDLE object) {
WatchForAddressChange();
}
-NetworkChangeNotifierWin::NetworkChangeNotifierWin(NetLog* net_log)
- : impl_(new Impl(ALLOW_THIS_IN_INITIALIZER_LIST(this))),
- net_log_(net_log) {
+NetworkChangeNotifierWin::NetworkChangeNotifierWin()
+ : impl_(new Impl(ALLOW_THIS_IN_INITIALIZER_LIST(this))) {
impl_->WatchForAddressChange();
}
void NetworkChangeNotifierWin::OnIPAddressChanged() {
DCHECK(CalledOnValidThread());
- BoundNetLog net_log =
- BoundNetLog::Make(net_log_, NetLog::SOURCE_NETWORK_CHANGE_NOTIFIER);
- net_log.AddEvent(NetLog::TYPE_NETWORK_IP_ADDRESS_CHANGED, NULL);
FOR_EACH_OBSERVER(Observer, observers_, OnIPAddressChanged());
}
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h
index 403377b..ba2f53dc 100644
--- a/net/base/network_change_notifier_win.h
+++ b/net/base/network_change_notifier_win.h
@@ -13,12 +13,10 @@
namespace net {
-class NetLog;
-
class NetworkChangeNotifierWin : public NetworkChangeNotifier,
public NonThreadSafe {
public:
- explicit NetworkChangeNotifierWin(NetLog* net_log);
+ NetworkChangeNotifierWin();
// Called by NetworkChangeNotifierWin::Impl.
void OnIPAddressChanged();
@@ -36,7 +34,6 @@ class NetworkChangeNotifierWin : public NetworkChangeNotifier,
// true so we assert that all observers have been removed.
ObserverList<Observer, false> observers_;
scoped_ptr<Impl> impl_;
- NetLog* const net_log_;
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin);
};