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