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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_wrapper.h
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8953da1af838a237bcfcb236080c58016d15ec0
--- /dev/null
+++ b/content/browser/service_worker/service_worker_context_wrapper.h
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_
+
+#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/service_worker_context.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace quota {
+class QuotaManagerProxy;
+}
+
+namespace content {
+
+class ServiceWorkerContextCore;
+
+// A refcounted wrapper class for our core object. Higher level content lib
+// classes keep references to this class on mutliple threads. The inner core
+// instance is strictly single threaded and is not refcounted, the core object
+// is what is used internally in the service worker lib.
+class ServiceWorkerContextWrapper
+ : NON_EXPORTED_BASE(public ServiceWorkerContext),
+ public base::RefCountedThreadSafe<ServiceWorkerContextWrapper> {
+ public:
+ ServiceWorkerContextWrapper(const base::FilePath& user_data_directory,
+ quota::QuotaManagerProxy* quota_manager_proxy);
+
+ // Called when the Profile/BrowserContext/StoragePartition is going away.
+ void Shutdown();
+
+ // Only for use on the IO thread.
+ ServiceWorkerContextCore* context();
+
+ private:
+ friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>;
+ virtual ~ServiceWorkerContextWrapper();
+
+ scoped_ptr<ServiceWorkerContextCore> context_core_;
+ scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
+ base::FilePath user_data_directory_;
+ bool is_shutdown_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698