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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get
(); } | 71 PassRefPtrWillBeRawPtr<ServiceWorker> controller() { return m_controller.get
(); } |
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 | 77 |
78 // WebServiceWorkerProviderClient overrides. | 78 // WebServiceWorkerProviderClient overrides. |
79 virtual void setController(WebServiceWorker*, bool shouldNotifyControllerCha
nge) override; | 79 virtual void setController(WebServiceWorker*, bool shouldNotifyControllerCha
nge) override; |
80 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) override; | 80 virtual void dispatchMessageEvent(WebServiceWorker*, const WebString& messag
e, const WebMessagePortChannelArray&) override; |
81 | 81 |
82 // EventTarget overrides. | 82 // EventTarget overrides. |
83 virtual ExecutionContext* executionContext() const override { return Context
LifecycleObserver::executionContext(); } | 83 virtual ExecutionContext* executionContext() const override { return Context
LifecycleObserver::executionContext(); } |
84 virtual const AtomicString& interfaceName() const override; | 84 virtual const AtomicString& interfaceName() const override; |
85 | 85 |
86 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); | 86 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); |
| 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
87 | 88 |
88 private: | 89 private: |
89 explicit ServiceWorkerContainer(ExecutionContext*); | 90 explicit ServiceWorkerContainer(ExecutionContext*); |
90 | 91 |
91 class GetRegistrationForReadyCallback; | 92 class GetRegistrationForReadyCallback; |
92 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; | 93 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; |
93 ReadyProperty* createReadyProperty(); | 94 ReadyProperty* createReadyProperty(); |
94 | 95 |
95 WebServiceWorkerProvider* m_provider; | 96 WebServiceWorkerProvider* m_provider; |
96 RefPtrWillBeMember<ServiceWorker> m_controller; | 97 RefPtrWillBeMember<ServiceWorker> m_controller; |
97 Member<ReadyProperty> m_ready; | 98 Member<ReadyProperty> m_ready; |
98 }; | 99 }; |
99 | 100 |
100 } // namespace blink | 101 } // namespace blink |
101 | 102 |
102 #endif // ServiceWorkerContainer_h | 103 #endif // ServiceWorkerContainer_h |
OLD | NEW |