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

Side by Side Diff: content/browser/service_worker/service_worker_handle.h

Issue 355163003: Don't prematurely delete script resources when registration is deleted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 10 matching lines...) Expand all
21 21
22 class ServiceWorkerContextCore; 22 class ServiceWorkerContextCore;
23 class ServiceWorkerRegistration; 23 class ServiceWorkerRegistration;
24 24
25 // Roughly corresponds to one ServiceWorker object in the renderer process 25 // Roughly corresponds to one ServiceWorker object in the renderer process
26 // (WebServiceWorkerImpl). 26 // (WebServiceWorkerImpl).
27 // Has references to the corresponding ServiceWorkerVersion and 27 // Has references to the corresponding ServiceWorkerVersion and
28 // ServiceWorkerRegistration (therefore they're guaranteed to be alive while 28 // ServiceWorkerRegistration (therefore they're guaranteed to be alive while
29 // this handle is around). 29 // this handle is around).
30 class CONTENT_EXPORT ServiceWorkerHandle 30 class CONTENT_EXPORT ServiceWorkerHandle
31 : public ServiceWorkerVersion::Listener { 31 : NON_EXPORTED_BASE(public ServiceWorkerVersion::Listener) {
32 public: 32 public:
33 // Creates a handle for a live version. The version's corresponding 33 // Creates a handle for a live version. The version's corresponding
34 // registration must be also alive. 34 // registration must be also alive.
35 // This may return NULL if |context|.get() or |version| is NULL. 35 // This may return NULL if |context|.get() or |version| is NULL.
36 // |sender| and |thread_id| will be used to send messages to the 36 // |sender| and |thread_id| will be used to send messages to the
37 // corresponding WebServiceWorkerImpl (which should live on |thread_id| 37 // corresponding WebServiceWorkerImpl (which should live on |thread_id|
38 // in the child process). 38 // in the child process).
39 static scoped_ptr<ServiceWorkerHandle> Create( 39 static scoped_ptr<ServiceWorkerHandle> Create(
40 base::WeakPtr<ServiceWorkerContextCore> context, 40 base::WeakPtr<ServiceWorkerContextCore> context,
41 IPC::Sender* sender, 41 IPC::Sender* sender,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 int ref_count_; // Created with 1. 83 int ref_count_; // Created with 1.
84 scoped_refptr<ServiceWorkerRegistration> registration_; 84 scoped_refptr<ServiceWorkerRegistration> registration_;
85 scoped_refptr<ServiceWorkerVersion> version_; 85 scoped_refptr<ServiceWorkerVersion> version_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandle); 87 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandle);
88 }; 88 };
89 89
90 } // namespace content 90 } // namespace content
91 91
92 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_ 92 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698