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

Side by Side Diff: public/platform/WebServiceWorkerRegistrationProxy.h

Issue 473743002: ServiceWorker: register() should return the existing registration object if available (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « public/platform/WebServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebServiceWorkerRegistrationProxy_h 5 #ifndef WebServiceWorkerRegistrationProxy_h
6 #define WebServiceWorkerRegistrationProxy_h 6 #define WebServiceWorkerRegistrationProxy_h
7 7
8 #include "public/platform/WebCommon.h"
9
8 namespace blink { 10 namespace blink {
9 11
12 class ServiceWorkerRegistration;
10 class WebServiceWorker; 13 class WebServiceWorker;
11 14
12 // A proxy interface, passed via WebServiceWorkerRegistration.setProxy() from 15 // A proxy interface, passed via WebServiceWorkerRegistration.setProxy() from
13 // blink to the embedder, to talk to the ServiceWorkerRegistration object from 16 // blink to the embedder, to talk to the ServiceWorkerRegistration object from
14 // embedder. 17 // embedder.
15 class WebServiceWorkerRegistrationProxy { 18 class WebServiceWorkerRegistrationProxy {
16 public: 19 public:
17 WebServiceWorkerRegistrationProxy() { } 20 WebServiceWorkerRegistrationProxy() : m_private(0) { }
18 virtual ~WebServiceWorkerRegistrationProxy() { } 21 virtual ~WebServiceWorkerRegistrationProxy() { }
19 22
20 // Notifies that the registration entered the installation process. 23 // Notifies that the registration entered the installation process.
21 // The installing worker should be accessible via 24 // The installing worker should be accessible via
22 // WebServiceWorkerRegistration.installing. 25 // WebServiceWorkerRegistration.installing.
23 virtual void dispatchUpdateFoundEvent() = 0; 26 virtual void dispatchUpdateFoundEvent() = 0;
24 27
25 virtual void setInstalling(WebServiceWorker*) = 0; 28 virtual void setInstalling(WebServiceWorker*) = 0;
26 virtual void setWaiting(WebServiceWorker*) = 0; 29 virtual void setWaiting(WebServiceWorker*) = 0;
27 virtual void setActive(WebServiceWorker*) = 0; 30 virtual void setActive(WebServiceWorker*) = 0;
31
32 #if INSIDE_BLINK
33 BLINK_PLATFORM_EXPORT WebServiceWorkerRegistrationProxy(ServiceWorkerRegistr ation*);
34 BLINK_PLATFORM_EXPORT operator ServiceWorkerRegistration*() const;
35 #endif
36
37 protected:
38 ServiceWorkerRegistration* m_private;
sof 2014/08/14 08:59:49 This is a GCed object; can you guarantee that the
nhiroki 2014/08/15 00:05:54 Thank you for pointing out! I think our subsequent
28 }; 39 };
29 40
30 } // namespace blink 41 } // namespace blink
31 42
32 #endif // WebServiceWorkerRegistrationProxy_h 43 #endif // WebServiceWorkerRegistrationProxy_h
OLDNEW
« no previous file with comments | « public/platform/WebServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698