Index: net/proxy/network_delegate_error_observer.cc |
diff --git a/net/proxy/network_delegate_error_observer.cc b/net/proxy/network_delegate_error_observer.cc |
index 8029141a0a4035024cbdc6750079a52447d81917..e92065beaefffa1ed0583e89281f70e2d08a7ab1 100644 |
--- a/net/proxy/network_delegate_error_observer.cc |
+++ b/net/proxy/network_delegate_error_observer.cc |
@@ -6,7 +6,7 @@ |
#include "base/bind.h" |
#include "base/location.h" |
-#include "base/message_loop/message_loop_proxy.h" |
+#include "base/single_thread_task_runner.h" |
#include "net/base/net_errors.h" |
#include "net/base/network_delegate.h" |
@@ -17,7 +17,8 @@ namespace net { |
class NetworkDelegateErrorObserver::Core |
: public base::RefCountedThreadSafe<NetworkDelegateErrorObserver::Core> { |
public: |
- Core(NetworkDelegate* network_delegate, base::MessageLoopProxy* origin_loop); |
+ Core(NetworkDelegate* network_delegate, |
+ base::SingleThreadTaskRunner* origin_runner); |
void NotifyPACScriptError(int line_number, const base::string16& error); |
@@ -29,16 +30,16 @@ class NetworkDelegateErrorObserver::Core |
virtual ~Core(); |
NetworkDelegate* network_delegate_; |
- scoped_refptr<base::MessageLoopProxy> origin_loop_; |
+ scoped_refptr<base::SingleThreadTaskRunner> origin_runner_; |
DISALLOW_COPY_AND_ASSIGN(Core); |
}; |
-NetworkDelegateErrorObserver::Core::Core(NetworkDelegate* network_delegate, |
- base::MessageLoopProxy* origin_loop) |
- : network_delegate_(network_delegate), |
- origin_loop_(origin_loop) { |
- DCHECK(origin_loop); |
+NetworkDelegateErrorObserver::Core::Core( |
+ NetworkDelegate* network_delegate, |
+ base::SingleThreadTaskRunner* origin_runner) |
+ : network_delegate_(network_delegate), origin_runner_(origin_runner) { |
+ DCHECK(origin_runner); |
} |
NetworkDelegateErrorObserver::Core::~Core() {} |
@@ -47,10 +48,9 @@ NetworkDelegateErrorObserver::Core::~Core() {} |
void NetworkDelegateErrorObserver::Core::NotifyPACScriptError( |
int line_number, |
const base::string16& error) { |
- if (!origin_loop_->BelongsToCurrentThread()) { |
- origin_loop_->PostTask( |
- FROM_HERE, |
- base::Bind(&Core::NotifyPACScriptError, this, line_number, error)); |
+ if (!origin_runner_->BelongsToCurrentThread()) { |
+ origin_runner_->PostTask(FROM_HERE, base::Bind(&Core::NotifyPACScriptError, |
+ this, line_number, error)); |
return; |
} |
if (network_delegate_) |
@@ -58,7 +58,7 @@ void NetworkDelegateErrorObserver::Core::NotifyPACScriptError( |
} |
void NetworkDelegateErrorObserver::Core::Shutdown() { |
- CHECK(origin_loop_->BelongsToCurrentThread()); |
+ CHECK(origin_runner_->BelongsToCurrentThread()); |
network_delegate_ = NULL; |
} |
@@ -66,8 +66,9 @@ void NetworkDelegateErrorObserver::Core::Shutdown() { |
NetworkDelegateErrorObserver::NetworkDelegateErrorObserver( |
NetworkDelegate* network_delegate, |
- base::MessageLoopProxy* origin_loop) |
- : core_(new Core(network_delegate, origin_loop)) {} |
+ base::SingleThreadTaskRunner* origin_runner) |
+ : core_(new Core(network_delegate, origin_runner)) { |
+} |
NetworkDelegateErrorObserver::~NetworkDelegateErrorObserver() { |
core_->Shutdown(); |