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

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

Issue 1159623009: content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test build fix. 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_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/barrier_closure.h" 12 #include "base/barrier_closure.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/location.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
17 #include "base/profiler/scoped_tracker.h" 18 #include "base/profiler/scoped_tracker.h"
19 #include "base/single_thread_task_runner.h"
20 #include "base/thread_task_runner_handle.h"
18 #include "base/threading/sequenced_worker_pool.h" 21 #include "base/threading/sequenced_worker_pool.h"
19 #include "content/browser/service_worker/service_worker_context_core.h" 22 #include "content/browser/service_worker/service_worker_context_core.h"
20 #include "content/browser/service_worker/service_worker_context_observer.h" 23 #include "content/browser/service_worker/service_worker_context_observer.h"
21 #include "content/browser/service_worker/service_worker_process_manager.h" 24 #include "content/browser/service_worker/service_worker_process_manager.h"
22 #include "content/browser/service_worker/service_worker_quota_client.h" 25 #include "content/browser/service_worker/service_worker_quota_client.h"
23 #include "content/browser/service_worker/service_worker_request_handler.h" 26 #include "content/browser/service_worker/service_worker_request_handler.h"
24 #include "content/browser/service_worker/service_worker_utils.h" 27 #include "content/browser/service_worker/service_worker_utils.h"
25 #include "content/browser/service_worker/service_worker_version.h" 28 #include "content/browser/service_worker/service_worker_version.h"
26 #include "content/browser/storage_partition_impl.h" 29 #include "content/browser/storage_partition_impl.h"
27 #include "content/public/browser/browser_context.h" 30 #include "content/public/browser/browser_context.h"
28 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/service_worker_context.h" 32 #include "content/public/browser/service_worker_context.h"
30 #include "net/base/net_errors.h" 33 #include "net/base/net_errors.h"
31 #include "net/base/net_util.h" 34 #include "net/base/net_util.h"
32 #include "storage/browser/quota/quota_manager_proxy.h" 35 #include "storage/browser/quota/quota_manager_proxy.h"
33 #include "storage/browser/quota/special_storage_policy.h" 36 #include "storage/browser/quota/special_storage_policy.h"
34 37
35 namespace content { 38 namespace content {
36 39
37 namespace { 40 namespace {
38 41
39 typedef std::set<std::string> HeaderNameSet; 42 typedef std::set<std::string> HeaderNameSet;
40 base::LazyInstance<HeaderNameSet> g_excluded_header_name_set = 43 base::LazyInstance<HeaderNameSet> g_excluded_header_name_set =
41 LAZY_INSTANCE_INITIALIZER; 44 LAZY_INSTANCE_INITIALIZER;
42 45
43 void RunSoon(const base::Closure& closure) { 46 void RunSoon(const base::Closure& closure) {
44 base::MessageLoop::current()->PostTask(FROM_HERE, closure); 47 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, closure);
45 } 48 }
46 49
47 void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback, 50 void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback,
48 ServiceWorkerStatusCode status) { 51 ServiceWorkerStatusCode status) {
49 DCHECK_CURRENTLY_ON(BrowserThread::IO); 52 DCHECK_CURRENTLY_ON(BrowserThread::IO);
50 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 53 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
51 base::Bind(callback, status)); 54 base::Bind(callback, status));
52 } 55 }
53 56
54 void StartActiveWorkerOnIO( 57 void StartActiveWorkerOnIO(
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 observer_list_->Notify(FROM_HERE, 644 observer_list_->Notify(FROM_HERE,
642 &ServiceWorkerContextObserver::OnStorageWiped); 645 &ServiceWorkerContextObserver::OnStorageWiped);
643 } 646 }
644 647
645 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 648 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
646 DCHECK_CURRENTLY_ON(BrowserThread::IO); 649 DCHECK_CURRENTLY_ON(BrowserThread::IO);
647 return context_core_.get(); 650 return context_core_.get();
648 } 651 }
649 652
650 } // namespace content 653 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698