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

Side by Side Diff: content/browser/service_worker/service_worker_register_job.cc

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_register_job.h" 5 #include "content/browser/service_worker/service_worker_register_job.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/location.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h"
12 #include "content/browser/service_worker/service_worker_context_core.h" 10 #include "content/browser/service_worker/service_worker_context_core.h"
13 #include "content/browser/service_worker/service_worker_job_coordinator.h" 11 #include "content/browser/service_worker/service_worker_job_coordinator.h"
14 #include "content/browser/service_worker/service_worker_metrics.h" 12 #include "content/browser/service_worker/service_worker_metrics.h"
15 #include "content/browser/service_worker/service_worker_registration.h" 13 #include "content/browser/service_worker/service_worker_registration.h"
16 #include "content/browser/service_worker/service_worker_storage.h" 14 #include "content/browser/service_worker/service_worker_storage.h"
17 #include "content/browser/service_worker/service_worker_utils.h" 15 #include "content/browser/service_worker/service_worker_utils.h"
18 #include "content/common/service_worker/service_worker_types.h" 16 #include "content/common/service_worker/service_worker_types.h"
19 #include "net/base/net_errors.h" 17 #include "net/base/net_errors.h"
20 18
21 namespace content { 19 namespace content {
22 20
23 namespace { 21 namespace {
24 22
25 void RunSoon(const base::Closure& closure) { 23 void RunSoon(const base::Closure& closure) {
26 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, closure); 24 base::MessageLoop::current()->PostTask(FROM_HERE, closure);
27 } 25 }
28 26
29 } // namespace 27 } // namespace
30 28
31 typedef ServiceWorkerRegisterJobBase::RegistrationJobType RegistrationJobType; 29 typedef ServiceWorkerRegisterJobBase::RegistrationJobType RegistrationJobType;
32 30
33 ServiceWorkerRegisterJob::ServiceWorkerRegisterJob( 31 ServiceWorkerRegisterJob::ServiceWorkerRegisterJob(
34 base::WeakPtr<ServiceWorkerContextCore> context, 32 base::WeakPtr<ServiceWorkerContextCore> context,
35 const GURL& pattern, 33 const GURL& pattern,
36 const GURL& script_url) 34 const GURL& script_url)
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 if (host->IsHostToRunningServiceWorker()) 565 if (host->IsHostToRunningServiceWorker())
568 continue; 566 continue;
569 if (!ServiceWorkerUtils::ScopeMatches(registration->pattern(), 567 if (!ServiceWorkerUtils::ScopeMatches(registration->pattern(),
570 host->document_url())) 568 host->document_url()))
571 continue; 569 continue;
572 host->AddMatchingRegistration(registration); 570 host->AddMatchingRegistration(registration);
573 } 571 }
574 } 572 }
575 573
576 } // namespace content 574 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698