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

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

Issue 70683002: Stub out ServiceWorkerRegistration and Version classes (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_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a3af16df773b741978d3353ef81a26854cacae5
--- /dev/null
+++ b/content/browser/service_worker/service_worker_version.h
@@ -0,0 +1,42 @@
+// Copyright (c) 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_VERSION_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
+
+#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+
+class GURL;
+
+namespace content {
+
+class ServiceWorkerRegistration;
+
+// This class acts as a persistent instance
+class CONTENT_EXPORT ServiceWorkerVersion
+ : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>) {
+ public:
+ explicit ServiceWorkerVersion(
+ scoped_refptr<ServiceWorkerRegistration> registration);
+
+ void Shutdown();
+
+ private:
+ ~ServiceWorkerVersion();
+ friend class base::RefCounted<ServiceWorkerVersion>;
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerRegistrationTest, Shutdown);
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerRegistrationTest, ActivateFirst);
+ FRIEND_TEST_ALL_PREFIXES(ServiceWorkerRegistrationTest, ActivateInWaiting);
+ bool IsShutdown() const { return is_shutdown_; }
+
+ bool is_shutdown_;
+ scoped_refptr<ServiceWorkerRegistration> registration_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
+};
+} // namespace content
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_

Powered by Google App Engine
This is Rietveld 408576698