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

Unified Diff: content/child/service_worker/service_worker_provider_context.cc

Issue 1142063003: content/child: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. 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 | « content/child/service_worker/service_worker_provider_context.h ('k') | content/child/thread_safe_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/service_worker/service_worker_provider_context.cc
diff --git a/content/child/service_worker/service_worker_provider_context.cc b/content/child/service_worker/service_worker_provider_context.cc
index d8273aaef4607725d961b6f3a48340f38e9825d5..c606d06d3d536a6e6734e89a5a23c675e7970a0d 100644
--- a/content/child/service_worker/service_worker_provider_context.cc
+++ b/content/child/service_worker/service_worker_provider_context.cc
@@ -5,8 +5,9 @@
#include "content/child/service_worker/service_worker_provider_context.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/location.h"
#include "base/stl_util.h"
+#include "base/thread_task_runner_handle.h"
#include "content/child/child_thread_impl.h"
#include "content/child/service_worker/service_worker_dispatcher.h"
#include "content/child/service_worker/service_worker_handle_reference.h"
@@ -19,7 +20,7 @@ namespace content {
ServiceWorkerProviderContext::ServiceWorkerProviderContext(int provider_id)
: provider_id_(provider_id),
- main_thread_loop_proxy_(base::MessageLoopProxy::current()) {
+ main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
if (!ChildThreadImpl::current())
return; // May be null in some tests.
thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender();
@@ -39,7 +40,7 @@ ServiceWorkerProviderContext::~ServiceWorkerProviderContext() {
}
ServiceWorkerHandleReference* ServiceWorkerProviderContext::controller() {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return controller_.get();
}
@@ -64,7 +65,7 @@ void ServiceWorkerProviderContext::SetVersionAttributes(
ChangedVersionAttributesMask mask,
const ServiceWorkerVersionAttributes& attrs) {
base::AutoLock lock(lock_);
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
DCHECK(registration_);
if (mask.installing_changed()) {
@@ -85,7 +86,7 @@ void ServiceWorkerProviderContext::OnAssociateRegistration(
const ServiceWorkerRegistrationObjectInfo& info,
const ServiceWorkerVersionAttributes& attrs) {
base::AutoLock lock(lock_);
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
DCHECK(!registration_);
DCHECK_NE(kInvalidServiceWorkerRegistrationId, info.registration_id);
DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, info.handle_id);
@@ -102,7 +103,7 @@ void ServiceWorkerProviderContext::OnAssociateRegistration(
void ServiceWorkerProviderContext::OnDisassociateRegistration() {
base::AutoLock lock(lock_);
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
controller_.reset();
active_.reset();
@@ -115,7 +116,7 @@ void ServiceWorkerProviderContext::OnServiceWorkerStateChanged(
int handle_id,
blink::WebServiceWorkerState state) {
base::AutoLock lock(lock_);
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
ServiceWorkerHandleReference* which = NULL;
if (handle_id == controller_handle_id())
@@ -139,7 +140,7 @@ void ServiceWorkerProviderContext::OnServiceWorkerStateChanged(
void ServiceWorkerProviderContext::OnSetControllerServiceWorker(
const ServiceWorkerObjectInfo& info) {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
DCHECK(registration_);
// This context is is the primary owner of this handle, keeps the
@@ -152,38 +153,38 @@ void ServiceWorkerProviderContext::OnSetControllerServiceWorker(
}
int ServiceWorkerProviderContext::installing_handle_id() const {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return installing_ ? installing_->info().handle_id
: kInvalidServiceWorkerHandleId;
}
int ServiceWorkerProviderContext::waiting_handle_id() const {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return waiting_ ? waiting_->info().handle_id
: kInvalidServiceWorkerHandleId;
}
int ServiceWorkerProviderContext::active_handle_id() const {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return active_ ? active_->info().handle_id
: kInvalidServiceWorkerHandleId;
}
int ServiceWorkerProviderContext::controller_handle_id() const {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return controller_ ? controller_->info().handle_id
: kInvalidServiceWorkerHandleId;
}
int ServiceWorkerProviderContext::registration_handle_id() const {
- DCHECK(main_thread_loop_proxy_->RunsTasksOnCurrentThread());
+ DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
return registration_ ? registration_->info().handle_id
: kInvalidServiceWorkerRegistrationHandleId;
}
void ServiceWorkerProviderContext::DestructOnMainThread() const {
- if (!main_thread_loop_proxy_->RunsTasksOnCurrentThread() &&
- main_thread_loop_proxy_->DeleteSoon(FROM_HERE, this)) {
+ if (!main_thread_task_runner_->RunsTasksOnCurrentThread() &&
+ main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) {
return;
}
delete this;
« no previous file with comments | « content/child/service_worker/service_worker_provider_context.h ('k') | content/child/thread_safe_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698