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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 ScriptPromise ready(ScriptState*); | 73 ScriptPromise ready(ScriptState*); |
74 WebServiceWorkerProvider* provider() { return m_provider; } | 74 WebServiceWorkerProvider* provider() { return m_provider; } |
75 | 75 |
76 void registerServiceWorkerImpl(ExecutionContext*, const KURL& scriptURL, con
st KURL& scope, PassOwnPtr<RegistrationCallbacks>); | 76 void registerServiceWorkerImpl(ExecutionContext*, const KURL& scriptURL, con
st KURL& scope, PassOwnPtr<RegistrationCallbacks>); |
77 | 77 |
78 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st RegistrationOptions&); | 78 ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, con
st RegistrationOptions&); |
79 ScriptPromise getRegistration(ScriptState*, const String& documentURL); | 79 ScriptPromise getRegistration(ScriptState*, const String& documentURL); |
80 ScriptPromise getRegistrations(ScriptState*); | 80 ScriptPromise getRegistrations(ScriptState*); |
81 | 81 |
82 // WebServiceWorkerProviderClient overrides. | 82 // WebServiceWorkerProviderClient overrides. |
83 void setController(WebPassOwnPtr<WebServiceWorker::Handle>, bool shouldNotif
yControllerChange) override; | 83 void setController(std::unique_ptr<WebServiceWorker::Handle>, bool shouldNot
ifyControllerChange) override; |
84 void dispatchMessageEvent(WebPassOwnPtr<WebServiceWorker::Handle>, const Web
String& message, const WebMessagePortChannelArray&) override; | 84 void dispatchMessageEvent(std::unique_ptr<WebServiceWorker::Handle>, const W
ebString& message, const WebMessagePortChannelArray&) override; |
85 | 85 |
86 // EventTarget overrides. | 86 // EventTarget overrides. |
87 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } | 87 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } |
88 const AtomicString& interfaceName() const override; | 88 const AtomicString& interfaceName() const override; |
89 | 89 |
90 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); | 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); |
91 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
92 | 92 |
93 private: | 93 private: |
94 explicit ServiceWorkerContainer(ExecutionContext*); | 94 explicit ServiceWorkerContainer(ExecutionContext*); |
95 | 95 |
96 class GetRegistrationForReadyCallback; | 96 class GetRegistrationForReadyCallback; |
97 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; | 97 typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<Service
WorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty; |
98 ReadyProperty* createReadyProperty(); | 98 ReadyProperty* createReadyProperty(); |
99 | 99 |
100 WebServiceWorkerProvider* m_provider; | 100 WebServiceWorkerProvider* m_provider; |
101 Member<ServiceWorker> m_controller; | 101 Member<ServiceWorker> m_controller; |
102 Member<ReadyProperty> m_ready; | 102 Member<ReadyProperty> m_ready; |
103 }; | 103 }; |
104 | 104 |
105 } // namespace blink | 105 } // namespace blink |
106 | 106 |
107 #endif // ServiceWorkerContainer_h | 107 #endif // ServiceWorkerContainer_h |
OLD | NEW |