Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef FetchEvent_h | 5 #ifndef FetchEvent_h |
| 6 #define FetchEvent_h | 6 #define FetchEvent_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | |
| 8 #include "modules/EventModules.h" | 9 #include "modules/EventModules.h" |
| 9 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| 10 #include "modules/fetch/Request.h" | 11 #include "modules/fetch/Request.h" |
| 11 #include "modules/serviceworkers/ExtendableEvent.h" | 12 #include "modules/serviceworkers/ExtendableEvent.h" |
| 12 #include "modules/serviceworkers/FetchEventInit.h" | 13 #include "modules/serviceworkers/FetchEventInit.h" |
| 13 #include "modules/serviceworkers/RespondWithObserver.h" | 14 #include "modules/serviceworkers/RespondWithObserver.h" |
| 14 #include "platform/heap/Handle.h" | 15 #include "platform/heap/Handle.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class ExceptionState; | 19 class ExceptionState; |
| 19 class Request; | 20 class Request; |
| 20 class RespondWithObserver; | 21 class RespondWithObserver; |
| 22 class ScriptPromise; | |
|
nhiroki
2015/07/29 08:52:18
nit: ScriptState? (This file already included Scri
jungkees
2015/07/29 09:12:23
Yeah, right. I finally removed the forward declara
| |
| 21 | 23 |
| 22 // A fetch event is dispatched by the client to a service worker's script | 24 // A fetch event is dispatched by the client to a service worker's script |
| 23 // context. RespondWithObserver can be used to notify the client about the | 25 // context. RespondWithObserver can be used to notify the client about the |
| 24 // service worker's response. | 26 // service worker's response. |
| 25 class MODULES_EXPORT FetchEvent final : public ExtendableEvent { | 27 class MODULES_EXPORT FetchEvent final : public ExtendableEvent { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 28 DEFINE_WRAPPERTYPEINFO(); |
| 27 public: | 29 public: |
| 28 static PassRefPtrWillBeRawPtr<FetchEvent> create(); | 30 static PassRefPtrWillBeRawPtr<FetchEvent> create(); |
| 29 static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, c onst FetchEventInit&); | 31 static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, c onst FetchEventInit&); |
| 30 static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, c onst FetchEventInit&, RespondWithObserver*); | 32 static PassRefPtrWillBeRawPtr<FetchEvent> create(const AtomicString& type, c onst FetchEventInit&, RespondWithObserver*); |
| 31 | 33 |
| 32 Request* request() const; | 34 Request* request() const; |
| 33 bool isReload() const; | 35 bool isReload() const; |
| 34 | 36 |
| 35 void respondWith(ScriptState*, ScriptPromise&, ExceptionState&); | 37 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); |
| 36 | 38 |
| 37 const AtomicString& interfaceName() const override; | 39 const AtomicString& interfaceName() const override; |
| 38 | 40 |
| 39 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
| 40 | 42 |
| 41 protected: | 43 protected: |
| 42 FetchEvent(); | 44 FetchEvent(); |
| 43 FetchEvent(const AtomicString& type, const FetchEventInit&, RespondWithObser ver*); | 45 FetchEvent(const AtomicString& type, const FetchEventInit&, RespondWithObser ver*); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 PersistentWillBeMember<RespondWithObserver> m_observer; | 48 PersistentWillBeMember<RespondWithObserver> m_observer; |
| 47 PersistentWillBeMember<Request> m_request; | 49 PersistentWillBeMember<Request> m_request; |
| 48 bool m_isReload; | 50 bool m_isReload; |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace blink | 53 } // namespace blink |
| 52 | 54 |
| 53 #endif // FetchEvent_h | 55 #endif // FetchEvent_h |
| OLD | NEW |