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

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

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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
7
8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/service_worker_context.h"
12
13 namespace base {
14 class FilePath;
15 }
16
17 namespace quota {
18 class QuotaManagerProxy;
19 }
20
21 namespace content {
22
23 class ServiceWorkerContextCore;
24
25 // A refcounted wrapper class for our core object. Higher level content lib
26 // classes keep references to this class on mutliple threads. The inner core
27 // instance is strictly single threaded and is not refcounted, the core object
28 // is what is used internally in the service worker lib.
29 class ServiceWorkerContextWrapper
30 : NON_EXPORTED_BASE(public ServiceWorkerContext),
31 public base::RefCountedThreadSafe<ServiceWorkerContextWrapper> {
32 public:
33 ServiceWorkerContextWrapper(const base::FilePath& user_data_directory,
34 quota::QuotaManagerProxy* quota_manager_proxy);
35
36 // Called when the Profile/BrowserContext/StoragePartition is going away.
37 void Shutdown();
38
39 // Only for use on the IO thread.
40 ServiceWorkerContextCore* context();
41
42 private:
43 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>;
44 virtual ~ServiceWorkerContextWrapper();
45
46 scoped_ptr<ServiceWorkerContextCore> context_core_;
47 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
48 base::FilePath user_data_directory_;
49 bool is_shutdown_;
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698