| 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/probe/CoreProbes.h" | 9 #include "core/probe/CoreProbes.h" |
| 10 #include "core/workers/WorkerGlobalScope.h" | 10 #include "core/workers/WorkerGlobalScope.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 return ScopedFetcher::From(window)->Fetch(script_state, input, init, | 105 return ScopedFetcher::From(window)->Fetch(script_state, input, init, |
| 106 exception_state); | 106 exception_state); |
| 107 } | 107 } |
| 108 | 108 |
| 109 ScriptPromise GlobalFetch::fetch(ScriptState* script_state, | 109 ScriptPromise GlobalFetch::fetch(ScriptState* script_state, |
| 110 WorkerGlobalScope& worker, | 110 WorkerGlobalScope& worker, |
| 111 const RequestInfo& input, | 111 const RequestInfo& input, |
| 112 const Dictionary& init, | 112 const Dictionary& init, |
| 113 ExceptionState& exception_state) { | 113 ExceptionState& exception_state) { |
| 114 // Note that UseCounter doesn't work with SharedWorker or ServiceWorker. | |
| 115 UseCounter::Count(worker.GetExecutionContext(), UseCounter::kFetch); | 114 UseCounter::Count(worker.GetExecutionContext(), UseCounter::kFetch); |
| 116 return ScopedFetcher::From(worker)->Fetch(script_state, input, init, | 115 return ScopedFetcher::From(worker)->Fetch(script_state, input, init, |
| 117 exception_state); | 116 exception_state); |
| 118 } | 117 } |
| 119 | 118 |
| 120 } // namespace blink | 119 } // namespace blink |
| OLD | NEW |