Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp

Issue 2217763003: Remove Blink-WebKit-only document.createEvent strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "modules/serviceworkers/FetchEvent.h" 5 #include "modules/serviceworkers/FetchEvent.h"
6 6
7 #include "bindings/core/v8/ToV8.h" 7 #include "bindings/core/v8/ToV8.h"
8 #include "bindings/core/v8/V8HiddenValue.h" 8 #include "bindings/core/v8/V8HiddenValue.h"
9 #include "modules/fetch/Request.h" 9 #include "modules/fetch/Request.h"
10 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" 10 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
11 #include "wtf/RefPtr.h" 11 #include "wtf/RefPtr.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 FetchEvent* FetchEvent::create()
16 {
17 return new FetchEvent();
18 }
19
20 FetchEvent* FetchEvent::create(ScriptState* scriptState, const AtomicString& typ e, const FetchEventInit& initializer) 15 FetchEvent* FetchEvent::create(ScriptState* scriptState, const AtomicString& typ e, const FetchEventInit& initializer)
21 { 16 {
22 return new FetchEvent(scriptState, type, initializer, nullptr, nullptr); 17 return new FetchEvent(scriptState, type, initializer, nullptr, nullptr);
23 } 18 }
24 19
25 FetchEvent* FetchEvent::create(ScriptState* scriptState, const AtomicString& typ e, const FetchEventInit& initializer, RespondWithObserver* respondWithObserver, WaitUntilObserver* waitUntilObserver) 20 FetchEvent* FetchEvent::create(ScriptState* scriptState, const AtomicString& typ e, const FetchEventInit& initializer, RespondWithObserver* respondWithObserver, WaitUntilObserver* waitUntilObserver)
26 { 21 {
27 return new FetchEvent(scriptState, type, initializer, respondWithObserver, w aitUntilObserver); 22 return new FetchEvent(scriptState, type, initializer, respondWithObserver, w aitUntilObserver);
28 } 23 }
29 24
(...skipping 17 matching lines...) Expand all
47 stopImmediatePropagation(); 42 stopImmediatePropagation();
48 if (m_observer) 43 if (m_observer)
49 m_observer->respondWith(scriptState, scriptPromise, exceptionState); 44 m_observer->respondWith(scriptState, scriptPromise, exceptionState);
50 } 45 }
51 46
52 const AtomicString& FetchEvent::interfaceName() const 47 const AtomicString& FetchEvent::interfaceName() const
53 { 48 {
54 return EventNames::FetchEvent; 49 return EventNames::FetchEvent;
55 } 50 }
56 51
57 FetchEvent::FetchEvent()
58 : m_isReload(false)
59 {
60 }
61
62 FetchEvent::FetchEvent(ScriptState* scriptState, const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* respondWithObserver, WaitUnti lObserver* waitUntilObserver) 52 FetchEvent::FetchEvent(ScriptState* scriptState, const AtomicString& type, const FetchEventInit& initializer, RespondWithObserver* respondWithObserver, WaitUnti lObserver* waitUntilObserver)
63 : ExtendableEvent(type, initializer, waitUntilObserver) 53 : ExtendableEvent(type, initializer, waitUntilObserver)
64 , m_observer(respondWithObserver) 54 , m_observer(respondWithObserver)
65 { 55 {
66 m_clientId = initializer.clientId(); 56 m_clientId = initializer.clientId();
67 m_isReload = initializer.isReload(); 57 m_isReload = initializer.isReload();
68 if (initializer.hasRequest()) { 58 if (initializer.hasRequest()) {
69 ScriptState::Scope scope(scriptState); 59 ScriptState::Scope scope(scriptState);
70 m_request = initializer.request(); 60 m_request = initializer.request();
71 v8::Local<v8::Value> request = toV8(m_request, scriptState); 61 v8::Local<v8::Value> request = toV8(m_request, scriptState);
(...skipping 16 matching lines...) Expand all
88 } 78 }
89 79
90 DEFINE_TRACE(FetchEvent) 80 DEFINE_TRACE(FetchEvent)
91 { 81 {
92 visitor->trace(m_observer); 82 visitor->trace(m_observer);
93 visitor->trace(m_request); 83 visitor->trace(m_request);
94 ExtendableEvent::trace(visitor); 84 ExtendableEvent::trace(visitor);
95 } 85 }
96 86
97 } // namespace blink 87 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698