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

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

Issue 1212643004: [Oilpan] Apply RefCountedGarbageCollectedEventTarget on AbstractWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove some redundant includes Created 5 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
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 25 matching lines...) Expand all
36 #include "bindings/core/v8/ScriptWrappable.h" 36 #include "bindings/core/v8/ScriptWrappable.h"
37 #include "core/dom/ContextLifecycleObserver.h" 37 #include "core/dom/ContextLifecycleObserver.h"
38 #include "core/events/EventTarget.h" 38 #include "core/events/EventTarget.h"
39 #include "modules/ModulesExport.h" 39 #include "modules/ModulesExport.h"
40 #include "modules/serviceworkers/RegistrationOptions.h" 40 #include "modules/serviceworkers/RegistrationOptions.h"
41 #include "modules/serviceworkers/ServiceWorker.h" 41 #include "modules/serviceworkers/ServiceWorker.h"
42 #include "modules/serviceworkers/ServiceWorkerRegistration.h" 42 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
43 #include "platform/heap/Handle.h" 43 #include "platform/heap/Handle.h"
44 #include "public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h " 44 #include "public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h "
45 #include "wtf/Forward.h" 45 #include "wtf/Forward.h"
46 #include "wtf/PassRefPtr.h"
47 #include "wtf/RefPtr.h"
48 46
49 namespace blink { 47 namespace blink {
50 48
51 class ExecutionContext; 49 class ExecutionContext;
52 class WebServiceWorker; 50 class WebServiceWorker;
53 class WebServiceWorkerProvider; 51 class WebServiceWorkerProvider;
54 class WebServiceWorkerRegistration; 52 class WebServiceWorkerRegistration;
55 53
56 class MODULES_EXPORT ServiceWorkerContainer final 54 class MODULES_EXPORT ServiceWorkerContainer final
57 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerCo ntainer> 55 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerCo ntainer>
58 , public ContextLifecycleObserver 56 , public ContextLifecycleObserver
59 , public WebServiceWorkerProviderClient { 57 , public WebServiceWorkerProviderClient {
60 DEFINE_WRAPPERTYPEINFO(); 58 DEFINE_WRAPPERTYPEINFO();
61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer); 59 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer);
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer); 60 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer);
63 public: 61 public:
64 static ServiceWorkerContainer* create(ExecutionContext*); 62 static ServiceWorkerContainer* create(ExecutionContext*);
65 ~ServiceWorkerContainer(); 63 ~ServiceWorkerContainer();
66 64
67 void willBeDetachedFromFrame(); 65 void willBeDetachedFromFrame();
68 66
69 DECLARE_VIRTUAL_TRACE(); 67 DECLARE_VIRTUAL_TRACE();
70 68
71 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get (); } 69 ServiceWorker* controller() { return m_controller; }
72 ScriptPromise ready(ScriptState*); 70 ScriptPromise ready(ScriptState*);
73 WebServiceWorkerProvider* provider() { return m_provider; } 71 WebServiceWorkerProvider* provider() { return m_provider; }
74 72
75 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st RegistrationOptions&); 73 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con st RegistrationOptions&);
76 ScriptPromise getRegistration(ScriptState*, const String& documentURL); 74 ScriptPromise getRegistration(ScriptState*, const String& documentURL);
77 ScriptPromise getRegistrations(ScriptState*); 75 ScriptPromise getRegistrations(ScriptState*);
78 76
79 // WebServiceWorkerProviderClient overrides. 77 // WebServiceWorkerProviderClient overrides.
80 void setController(WebServiceWorker*, bool shouldNotifyControllerChange) ove rride; 78 void setController(WebServiceWorker*, bool shouldNotifyControllerChange) ove rride;
81 void dispatchMessageEvent(WebServiceWorker*, const WebString& message, const WebMessagePortChannelArray&) override; 79 void dispatchMessageEvent(WebServiceWorker*, const WebString& message, const WebMessagePortChannelArray&) override;
82 80
83 // EventTarget overrides. 81 // EventTarget overrides.
84 ExecutionContext* executionContext() const override { return ContextLifecycl eObserver::executionContext(); } 82 ExecutionContext* executionContext() const override { return ContextLifecycl eObserver::executionContext(); }
85 const AtomicString& interfaceName() const override; 83 const AtomicString& interfaceName() const override;
86 84
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); 85 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange);
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); 86 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
89 87
90 private: 88 private:
91 explicit ServiceWorkerContainer(ExecutionContext*); 89 explicit ServiceWorkerContainer(ExecutionContext*);
92 90
93 class GetRegistrationForReadyCallback; 91 class GetRegistrationForReadyCallback;
94 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; 92 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty;
95 ReadyProperty* createReadyProperty(); 93 ReadyProperty* createReadyProperty();
96 94
97 WebServiceWorkerProvider* m_provider; 95 WebServiceWorkerProvider* m_provider;
98 RefPtrWillBeMember<ServiceWorker> m_controller; 96 Member<ServiceWorker> m_controller;
99 Member<ReadyProperty> m_ready; 97 Member<ReadyProperty> m_ready;
100 }; 98 };
101 99
102 } // namespace blink 100 } // namespace blink
103 101
104 #endif // ServiceWorkerContainer_h 102 #endif // ServiceWorkerContainer_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorker.idl ('k') | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698