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 "modules/fetch/GlobalFetch.h" | 5 #include "modules/fetch/GlobalFetch.h" |
6 | 6 |
7 #include "core/frame/LocalDOMWindow.h" | 7 #include "core/frame/LocalDOMWindow.h" |
8 #include "core/frame/UseCounter.h" | 8 #include "core/frame/UseCounter.h" |
9 #include "core/workers/WorkerGlobalScope.h" | 9 #include "core/workers/WorkerGlobalScope.h" |
10 #include "modules/fetch/FetchManager.h" | 10 #include "modules/fetch/FetchManager.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 }; | 75 }; |
76 | 76 |
77 } // namespace | 77 } // namespace |
78 | 78 |
79 GlobalFetch::ScopedFetcher::~ScopedFetcher() | 79 GlobalFetch::ScopedFetcher::~ScopedFetcher() |
80 { | 80 { |
81 } | 81 } |
82 | 82 |
83 WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from
(DOMWindow& window) | 83 WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from
(DOMWindow& window) |
84 { | 84 { |
85 return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), windo
w.executionContext()); | 85 return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), windo
w.getExecutionContext()); |
86 } | 86 } |
87 | 87 |
88 WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from
(WorkerGlobalScope& worker) | 88 WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from
(WorkerGlobalScope& worker) |
89 { | 89 { |
90 return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.executionCont
ext()); | 90 return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.getExecutionC
ontext()); |
91 } | 91 } |
92 | 92 |
93 DEFINE_TRACE(GlobalFetch::ScopedFetcher) | 93 DEFINE_TRACE(GlobalFetch::ScopedFetcher) |
94 { | 94 { |
95 } | 95 } |
96 | 96 |
97 ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, DOMWindow& window, co
nst RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) | 97 ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, DOMWindow& window, co
nst RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) |
98 { | 98 { |
99 UseCounter::count(window.executionContext(), UseCounter::Fetch); | 99 UseCounter::count(window.getExecutionContext(), UseCounter::Fetch); |
100 return ScopedFetcher::from(window)->fetch(scriptState, input, init, exceptio
nState); | 100 return ScopedFetcher::from(window)->fetch(scriptState, input, init, exceptio
nState); |
101 } | 101 } |
102 | 102 |
103 ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, WorkerGlobalScope& wo
rker, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptio
nState) | 103 ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, WorkerGlobalScope& wo
rker, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptio
nState) |
104 { | 104 { |
105 // Note that UseCounter doesn't work with SharedWorker or ServiceWorker. | 105 // Note that UseCounter doesn't work with SharedWorker or ServiceWorker. |
106 UseCounter::count(worker.executionContext(), UseCounter::Fetch); | 106 UseCounter::count(worker.getExecutionContext(), UseCounter::Fetch); |
107 return ScopedFetcher::from(worker)->fetch(scriptState, input, init, exceptio
nState); | 107 return ScopedFetcher::from(worker)->fetch(scriptState, input, init, exceptio
nState); |
108 } | 108 } |
109 | 109 |
110 } // namespace blink | 110 } // namespace blink |
OLD | NEW |