OLD | NEW |
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer); | 61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer); | 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer); |
63 public: | 63 public: |
64 static ServiceWorkerContainer* create(ExecutionContext*); | 64 static ServiceWorkerContainer* create(ExecutionContext*); |
65 ~ServiceWorkerContainer(); | 65 ~ServiceWorkerContainer(); |
66 | 66 |
67 void willBeDetachedFromFrame(); | 67 void willBeDetachedFromFrame(); |
68 | 68 |
69 DECLARE_VIRTUAL_TRACE(); | 69 DECLARE_VIRTUAL_TRACE(); |
70 | 70 |
71 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get
(); } | 71 ServiceWorker* controller() { return m_controller; } |
72 ScriptPromise ready(ScriptState*); | 72 ScriptPromise ready(ScriptState*); |
73 WebServiceWorkerProvider* provider() { return m_provider; } | 73 WebServiceWorkerProvider* provider() { return m_provider; } |
74 | 74 |
75 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st RegistrationOptions&); | 75 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st RegistrationOptions&); |
76 ScriptPromise getRegistration(ScriptState*, const String& documentURL); | 76 ScriptPromise getRegistration(ScriptState*, const String& documentURL); |
77 ScriptPromise getRegistrations(ScriptState*); | 77 ScriptPromise getRegistrations(ScriptState*); |
78 | 78 |
79 // WebServiceWorkerProviderClient overrides. | 79 // WebServiceWorkerProviderClient overrides. |
80 void setController(WebServiceWorker*, bool shouldNotifyControllerChange) ove
rride; | 80 void setController(WebServiceWorker*, bool shouldNotifyControllerChange) ove
rride; |
81 void dispatchMessageEvent(WebServiceWorker*, const WebString& message, const
WebMessagePortChannelArray&) override; | 81 void dispatchMessageEvent(WebServiceWorker*, const WebString& message, const
WebMessagePortChannelArray&) override; |
82 | 82 |
83 // EventTarget overrides. | 83 // EventTarget overrides. |
84 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } | 84 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } |
85 const AtomicString& interfaceName() const override; | 85 const AtomicString& interfaceName() const override; |
86 | 86 |
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); | 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); |
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
89 | 89 |
90 private: | 90 private: |
91 explicit ServiceWorkerContainer(ExecutionContext*); | 91 explicit ServiceWorkerContainer(ExecutionContext*); |
92 | 92 |
93 class GetRegistrationForReadyCallback; | 93 class GetRegistrationForReadyCallback; |
94 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; | 94 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; |
95 ReadyProperty* createReadyProperty(); | 95 ReadyProperty* createReadyProperty(); |
96 | 96 |
97 WebServiceWorkerProvider* m_provider; | 97 WebServiceWorkerProvider* m_provider; |
98 RefPtrWillBeMember<ServiceWorker> m_controller; | 98 Member<ServiceWorker> m_controller; |
99 Member<ReadyProperty> m_ready; | 99 Member<ReadyProperty> m_ready; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace blink | 102 } // namespace blink |
103 | 103 |
104 #endif // ServiceWorkerContainer_h | 104 #endif // ServiceWorkerContainer_h |
OLD | NEW |