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

Side by Side Diff: content/browser/service_worker/service_worker_context_wrapper.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_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"
17 #include "base/logging.h" 16 #include "base/logging.h"
18 #include "base/profiler/scoped_tracker.h" 17 #include "base/profiler/scoped_tracker.h"
19 #include "base/single_thread_task_runner.h"
20 #include "base/thread_task_runner_handle.h"
21 #include "base/threading/sequenced_worker_pool.h" 18 #include "base/threading/sequenced_worker_pool.h"
22 #include "content/browser/service_worker/service_worker_context_core.h" 19 #include "content/browser/service_worker/service_worker_context_core.h"
23 #include "content/browser/service_worker/service_worker_context_observer.h" 20 #include "content/browser/service_worker/service_worker_context_observer.h"
24 #include "content/browser/service_worker/service_worker_process_manager.h" 21 #include "content/browser/service_worker/service_worker_process_manager.h"
25 #include "content/browser/service_worker/service_worker_quota_client.h" 22 #include "content/browser/service_worker/service_worker_quota_client.h"
26 #include "content/browser/service_worker/service_worker_request_handler.h" 23 #include "content/browser/service_worker/service_worker_request_handler.h"
27 #include "content/browser/service_worker/service_worker_utils.h" 24 #include "content/browser/service_worker/service_worker_utils.h"
28 #include "content/browser/service_worker/service_worker_version.h" 25 #include "content/browser/service_worker/service_worker_version.h"
29 #include "content/browser/storage_partition_impl.h" 26 #include "content/browser/storage_partition_impl.h"
30 #include "content/public/browser/browser_context.h" 27 #include "content/public/browser/browser_context.h"
31 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/service_worker_context.h" 29 #include "content/public/browser/service_worker_context.h"
33 #include "net/base/net_errors.h" 30 #include "net/base/net_errors.h"
34 #include "net/base/net_util.h" 31 #include "net/base/net_util.h"
35 #include "storage/browser/quota/quota_manager_proxy.h" 32 #include "storage/browser/quota/quota_manager_proxy.h"
36 #include "storage/browser/quota/special_storage_policy.h" 33 #include "storage/browser/quota/special_storage_policy.h"
37 34
38 namespace content { 35 namespace content {
39 36
40 namespace { 37 namespace {
41 38
42 typedef std::set<std::string> HeaderNameSet; 39 typedef std::set<std::string> HeaderNameSet;
43 base::LazyInstance<HeaderNameSet> g_excluded_header_name_set = 40 base::LazyInstance<HeaderNameSet> g_excluded_header_name_set =
44 LAZY_INSTANCE_INITIALIZER; 41 LAZY_INSTANCE_INITIALIZER;
45 42
46 void RunSoon(const base::Closure& closure) { 43 void RunSoon(const base::Closure& closure) {
47 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, closure); 44 base::MessageLoop::current()->PostTask(FROM_HERE, closure);
48 } 45 }
49 46
50 void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback, 47 void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback,
51 ServiceWorkerStatusCode status) { 48 ServiceWorkerStatusCode status) {
52 DCHECK_CURRENTLY_ON(BrowserThread::IO); 49 DCHECK_CURRENTLY_ON(BrowserThread::IO);
53 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 50 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
54 base::Bind(callback, status)); 51 base::Bind(callback, status));
55 } 52 }
56 53
57 void StartActiveWorkerOnIO( 54 void StartActiveWorkerOnIO(
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 observer_list_->Notify(FROM_HERE, 641 observer_list_->Notify(FROM_HERE,
645 &ServiceWorkerContextObserver::OnStorageWiped); 642 &ServiceWorkerContextObserver::OnStorageWiped);
646 } 643 }
647 644
648 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 645 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
649 DCHECK_CURRENTLY_ON(BrowserThread::IO); 646 DCHECK_CURRENTLY_ON(BrowserThread::IO);
650 return context_core_.get(); 647 return context_core_.get();
651 } 648 }
652 649
653 } // namespace content 650 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698