| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "FetchEvent.h" |
| 7 |
| 8 #include "core/events/ThreadLocalEventNames.h" |
| 9 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
| 10 #include "wtf/RefPtr.h" |
| 11 |
| 12 namespace WebCore { |
| 13 |
| 14 PassRefPtr<FetchEvent> FetchEvent::create() |
| 15 { |
| 16 return adoptRef(new FetchEvent()); |
| 17 } |
| 18 |
| 19 PassRefPtr<FetchEvent> FetchEvent::create(PassRefPtr<RespondWithObserver> observ
er) |
| 20 { |
| 21 return adoptRef(new FetchEvent(observer)); |
| 22 } |
| 23 |
| 24 void FetchEvent::respondWith(const ScriptValue& value) |
| 25 { |
| 26 m_observer->respondWith(value); |
| 27 } |
| 28 |
| 29 const AtomicString& FetchEvent::interfaceName() const |
| 30 { |
| 31 return EventNames::FetchEvent; |
| 32 } |
| 33 |
| 34 FetchEvent::FetchEvent() |
| 35 { |
| 36 ScriptWrappable::init(this); |
| 37 } |
| 38 |
| 39 FetchEvent::FetchEvent(PassRefPtr<RespondWithObserver> observer) |
| 40 : Event(EventTypeNames::fetch, /*canBubble=*/false, /*cancelable=*/true) |
| 41 , m_observer(observer) |
| 42 { |
| 43 ScriptWrappable::init(this); |
| 44 } |
| 45 |
| 46 } // namespace WebCore |
| OLD | NEW |