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

Unified Diff: content/child/service_worker/service_worker_registration_handle_reference.h

Issue 463013002: ServiceWorker: Implement updatefound event and version attributes (Chromium) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address for comments Created 6 years, 4 months 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/child/service_worker/service_worker_registration_handle_reference.h
diff --git a/content/child/service_worker/service_worker_registration_handle_reference.h b/content/child/service_worker/service_worker_registration_handle_reference.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdfb1095cc881a986d18b421649d8c5fd581b483
--- /dev/null
+++ b/content/child/service_worker/service_worker_registration_handle_reference.h
@@ -0,0 +1,53 @@
+// Copyright 2014 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_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENCE_H_
+#define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENCE_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "url/gurl.h"
+
+namespace content {
+
+class ThreadSafeSender;
+struct ServiceWorkerObjectInfo;
+
+class ServiceWorkerRegistrationHandleReference {
+ public:
+ // Creates a new ServiceWorkerRegistrationHandleReference and increments
+ // ref-count.
+ static scoped_ptr<ServiceWorkerRegistrationHandleReference> Create(
+ int registration_handle_id,
+ const ServiceWorkerObjectInfo& info,
+ ThreadSafeSender* sender);
+
+ // Creates a new ServiceWorkerRegistrationHandleReference by adopting a
+ // ref-count.
+ static scoped_ptr<ServiceWorkerRegistrationHandleReference> Adopt(
+ int registration_handle_id,
+ const ServiceWorkerObjectInfo& info,
+ ThreadSafeSender* sender);
+
+ ~ServiceWorkerRegistrationHandleReference();
+
+ int handle_id() const { return handle_id_; }
+ GURL scope() const { return scope_; }
+
+ private:
+ ServiceWorkerRegistrationHandleReference(int registration_handle_id,
+ const ServiceWorkerObjectInfo& info,
+ ThreadSafeSender* sender,
+ bool increment_ref_in_ctor);
+
+ const int handle_id_;
+ const GURL scope_;
+ scoped_refptr<ThreadSafeSender> sender_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandleReference);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENCE_H_

Powered by Google App Engine
This is Rietveld 408576698