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

Side by Side Diff: content/child/service_worker/service_worker_handle_reference.h

Issue 1469123003: ServiceWorker: Ensure that ServiceWorkerDispatcher always adopts passed handle references (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h"
10 #include "content/common/service_worker/service_worker_types.h" 11 #include "content/common/service_worker/service_worker_types.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 class ThreadSafeSender; 15 class ThreadSafeSender;
15 16
16 // Represents an interprocess reference to ServiceWorkerHandle managed in the 17 // Represents an interprocess reference to ServiceWorkerHandle managed in the
17 // browser process. The constructor and destructor sends a message to increment 18 // browser process. The constructor and destructor sends a message to increment
18 // or decrement the reference count to the browser process. 19 // or decrement the reference count to the browser process.
19 class ServiceWorkerHandleReference { 20 class CONTENT_EXPORT ServiceWorkerHandleReference {
20 public: 21 public:
21 // Creates a new ServiceWorkerHandleReference and increments ref-count. 22 // Creates a new ServiceWorkerHandleReference and increments ref-count.
22 static scoped_ptr<ServiceWorkerHandleReference> Create( 23 static scoped_ptr<ServiceWorkerHandleReference> Create(
23 const ServiceWorkerObjectInfo& info, 24 const ServiceWorkerObjectInfo& info,
24 ThreadSafeSender* sender); 25 ThreadSafeSender* sender);
25 26
26 // Creates a new ServiceWorkerHandleReference by adopting a ref-count. 27 // Creates a new ServiceWorkerHandleReference by adopting a ref-count.
27 static scoped_ptr<ServiceWorkerHandleReference> Adopt( 28 static scoped_ptr<ServiceWorkerHandleReference> Adopt(
28 const ServiceWorkerObjectInfo& info, 29 const ServiceWorkerObjectInfo& info,
29 ThreadSafeSender* sender); 30 ThreadSafeSender* sender);
(...skipping 12 matching lines...) Expand all
42 ThreadSafeSender* sender, 43 ThreadSafeSender* sender,
43 bool increment_ref_in_ctor); 44 bool increment_ref_in_ctor);
44 ServiceWorkerObjectInfo info_; 45 ServiceWorkerObjectInfo info_;
45 scoped_refptr<ThreadSafeSender> sender_; 46 scoped_refptr<ThreadSafeSender> sender_;
46 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleReference); 47 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleReference);
47 }; 48 };
48 49
49 } // namespace content 50 } // namespace content
50 51
51 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_ 52 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_HANDLE_REFERENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698