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

Side by Side Diff: Source/modules/serviceworkers/Body.cpp

Issue 692443002: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "modules/serviceworkers/Body.h" 6 #include "modules/serviceworkers/Body.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
11 #include "core/dom/DOMArrayBuffer.h" 11 #include "core/dom/DOMArrayBuffer.h"
12 #include "core/fileapi/Blob.h" 12 #include "core/fileapi/Blob.h"
13 #include "core/fileapi/FileReaderLoader.h" 13 #include "core/fileapi/FileReaderLoader.h"
14 #include "core/fileapi/FileReaderLoaderClient.h" 14 #include "core/fileapi/FileReaderLoaderClient.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 ScriptPromise Body::readAsync(ScriptState* scriptState, ResponseType type) 18 ScriptPromise Body::readAsync(ScriptState* scriptState, ResponseType type)
19 { 19 {
20 if (m_bodyUsed) 20 if (m_bodyUsed)
21 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("Already read", scriptState->isolate())); 21 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "Already read"));
22 22
23 // When the main thread sends a V8::TerminateExecution() signal to a worker 23 // When the main thread sends a V8::TerminateExecution() signal to a worker
24 // thread, any V8 API on the worker thread starts returning an empty 24 // thread, any V8 API on the worker thread starts returning an empty
25 // handle. This can happen in Body::readAsync. To avoid the situation, we 25 // handle. This can happen in Body::readAsync. To avoid the situation, we
26 // first check the ExecutionContext and return immediately if it's already 26 // first check the ExecutionContext and return immediately if it's already
27 // gone (which means that the V8::TerminateExecution() signal has been sent 27 // gone (which means that the V8::TerminateExecution() signal has been sent
28 // to this worker thread). 28 // to this worker thread).
29 ExecutionContext* executionContext = scriptState->executionContext(); 29 ExecutionContext* executionContext = scriptState->executionContext();
30 if (!executionContext) 30 if (!executionContext)
31 return ScriptPromise(); 31 return ScriptPromise();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 { 197 {
198 ASSERT(m_resolver); 198 ASSERT(m_resolver);
199 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped()) 199 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped())
200 return; 200 return;
201 201
202 m_resolver->resolve(""); 202 m_resolver->resolve("");
203 m_resolver.clear(); 203 m_resolver.clear();
204 } 204 }
205 205
206 } // namespace blink 206 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698