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

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

Issue 61023005: service worker scaffolding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6
7 #include "base/files/file_path.h"
8 #include "content/browser/service_worker/service_worker_context_core.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "webkit/browser/quota/quota_manager.h"
11
12 namespace content {
13
14 ServiceWorkerContextWrapper::ServiceWorkerContextWrapper() {
15 }
16
17 ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() {
18 }
19
20 void ServiceWorkerContextWrapper::Init(
21 const base::FilePath& user_data_directory,
22 quota::QuotaManagerProxy* quota_manager_proxy) {
23 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
alecflett 2013/11/11 18:59:03 Since, as it exists today, it will always be calle
michaeln 2013/11/11 20:56:38 But the wrapper is created by StoragePartitionImpl
24 BrowserThread::PostTask(
25 BrowserThread::IO, FROM_HERE,
26 base::Bind(&ServiceWorkerContextWrapper::Init, this,
27 user_data_directory, quota_manager_proxy));
28 return;
29 }
30 context_core_.reset(
31 new ServiceWorkerContextCore(
32 user_data_directory, quota_manager_proxy));
33 }
34
35
36 void ServiceWorkerContextWrapper::Shutdown() {
37 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
38 BrowserThread::PostTask(
39 BrowserThread::IO, FROM_HERE,
40 base::Bind(&ServiceWorkerContextWrapper::Shutdown, this));
41 return;
42 }
43 context_core_.reset();
44 }
45
46 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
48 return context_core_.get();
49 }
50
51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698