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

Unified Diff: content/browser/service_worker/service_worker_provider_host.h

Issue 70533005: More scaffolding, add class ServiceWorkerProviderHost. (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_provider_host.h
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..09990b61126f87315d1828fff08ebb0894210c56
--- /dev/null
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -0,0 +1,42 @@
+// 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_PROVIDER_HOST_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace content {
+
+class ServiceWorkerVersion;
+
+// This class is the browser-process representation of a serice worker
+// provider. There is a provider per document and the lifetime of this
+// object is tied to the lifetime of its document in the renderer process.
+// This class holds service worker state this is scoped to an individual
+// document.
+class ServiceWorkerProviderHost {
+ public:
+ ServiceWorkerProviderHost(int process_id,
+ int provider_id);
+ ~ServiceWorkerProviderHost();
+
+ int process_id() const { return process_id_; }
+ int provider_id() const { return provider_id_; }
+
+ // The service worker version that corresponds with navigator.serviceWorker
+ // for our document.
+ ServiceWorkerVersion* associated_version() const {
+ return associated_version_.get();
+ }
+
+ private:
+ const int process_id_;
+ const int provider_id_;
+ scoped_refptr<ServiceWorkerVersion> associated_version_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698