Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: net/proxy/network_delegate_error_observer.cc

Issue 1141573002: [net/proxy] Usage of ThreadTaskRunnerHandle & SingleThreadTaskRunner instead of MLP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/network_delegate_error_observer.h ('k') | net/proxy/network_delegate_error_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « net/proxy/network_delegate_error_observer.h ('k') | net/proxy/network_delegate_error_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698