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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerContainer.h

Issue 328663010: Simplify ServiceWorkerContainer's access to its window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring patch to head. Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef ServiceWorkerContainer_h 31 #ifndef ServiceWorkerContainer_h
32 #define ServiceWorkerContainer_h 32 #define ServiceWorkerContainer_h
33 33
34 #include "bindings/v8/ScriptPromise.h" 34 #include "bindings/v8/ScriptPromise.h"
35 #include "bindings/v8/ScriptWrappable.h" 35 #include "bindings/v8/ScriptWrappable.h"
36 #include "core/dom/ContextLifecycleObserver.h" 36 #include "core/dom/ContextLifecycleObserver.h"
37 #include "core/frame/DOMWindowLifecycleObserver.h"
38 #include "modules/serviceworkers/ServiceWorker.h" 37 #include "modules/serviceworkers/ServiceWorker.h"
39 #include "public/platform/WebServiceWorkerProviderClient.h" 38 #include "public/platform/WebServiceWorkerProviderClient.h"
40 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
41 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
42 #include "wtf/RefCounted.h" 41 #include "wtf/RefCounted.h"
43 42
44 namespace blink { 43 namespace blink {
45 class WebServiceWorkerProvider; 44 class WebServiceWorkerProvider;
46 class WebServiceWorker; 45 class WebServiceWorker;
47 } 46 }
48 47
49 namespace WebCore { 48 namespace WebCore {
50 49
51 class Dictionary; 50 class Dictionary;
52 class ExecutionContext; 51 class ExecutionContext;
53 class ServiceWorker; 52 class ServiceWorker;
54 53
55 class ServiceWorkerContainer FINAL : 54 class ServiceWorkerContainer FINAL :
56 public RefCounted<ServiceWorkerContainer>, 55 public RefCounted<ServiceWorkerContainer>,
57 public ScriptWrappable, 56 public ScriptWrappable,
58 public ContextLifecycleObserver, 57 public ContextLifecycleObserver,
59 public DOMWindowLifecycleObserver,
60 public blink::WebServiceWorkerProviderClient { 58 public blink::WebServiceWorkerProviderClient {
61 public: 59 public:
62 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*); 60 static PassRefPtr<ServiceWorkerContainer> create(ExecutionContext*);
63 ~ServiceWorkerContainer(); 61 ~ServiceWorkerContainer();
64 62
65 void detachClient(); 63 void detachClient();
66 64
67 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); } 65 PassRefPtrWillBeRawPtr<ServiceWorker> waiting() { return m_waiting.get(); }
68 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); } 66 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); }
69 ScriptPromise ready(ScriptState*); 67 ScriptPromise ready(ScriptState*);
(...skipping 13 matching lines...) Expand all
83 explicit ServiceWorkerContainer(ExecutionContext*); 81 explicit ServiceWorkerContainer(ExecutionContext*);
84 82
85 blink::WebServiceWorkerProvider* m_provider; 83 blink::WebServiceWorkerProvider* m_provider;
86 RefPtr<ServiceWorker> m_waiting; 84 RefPtr<ServiceWorker> m_waiting;
87 RefPtr<ServiceWorker> m_controller; 85 RefPtr<ServiceWorker> m_controller;
88 }; 86 };
89 87
90 } // namespace WebCore 88 } // namespace WebCore
91 89
92 #endif // ServiceWorkerContainer_h 90 #endif // ServiceWorkerContainer_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698