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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp

Issue 1804043002: Revert of Remove V8RecrusionScope, cleanup call sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "bindings/core/v8/ReadableStreamOperations.h" 5 #include "bindings/core/v8/ReadableStreamOperations.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptFunction.h" 8 #include "bindings/core/v8/ScriptFunction.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
11 #include "bindings/core/v8/V8Binding.h" 11 #include "bindings/core/v8/V8Binding.h"
12 #include "bindings/core/v8/V8BindingForTesting.h" 12 #include "bindings/core/v8/V8BindingForTesting.h"
13 #include "bindings/core/v8/V8BindingMacros.h" 13 #include "bindings/core/v8/V8BindingMacros.h"
14 #include "bindings/core/v8/V8IteratorResultValue.h" 14 #include "bindings/core/v8/V8IteratorResultValue.h"
15 #include "bindings/core/v8/V8RecursionScope.h"
15 #include "bindings/core/v8/V8ThrowException.h" 16 #include "bindings/core/v8/V8ThrowException.h"
16 #include "core/dom/Document.h" 17 #include "core/dom/Document.h"
17 #include "core/streams/ReadableStreamController.h" 18 #include "core/streams/ReadableStreamController.h"
18 #include "core/streams/UnderlyingSourceBase.h" 19 #include "core/streams/UnderlyingSourceBase.h"
19 #include "platform/heap/Handle.h" 20 #include "platform/heap/Handle.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 #include <v8.h> 22 #include <v8.h>
22 23
23 namespace blink { 24 namespace blink {
24 25
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_FALSE(m_block.HasCaught()); 143 EXPECT_FALSE(m_block.HasCaught());
143 } 144 }
144 145
145 ScriptState* getScriptState() const { return m_scope.getScriptState(); } 146 ScriptState* getScriptState() const { return m_scope.getScriptState(); }
146 v8::Isolate* isolate() const { return getScriptState()->isolate(); } 147 v8::Isolate* isolate() const { return getScriptState()->isolate(); }
147 148
148 ScriptValue eval(const char* s) 149 ScriptValue eval(const char* s)
149 { 150 {
150 v8::Local<v8::String> source; 151 v8::Local<v8::String> source;
151 v8::Local<v8::Script> script; 152 v8::Local<v8::Script> script;
152 v8::MicrotasksScope microtasks(isolate(), v8::MicrotasksScope::kDoNotRun Microtasks); 153 V8RecursionScope::MicrotaskSuppression microtasks(isolate());
153 if (!v8Call(v8::String::NewFromUtf8(isolate(), s, v8::NewStringType::kNo rmal), source)) { 154 if (!v8Call(v8::String::NewFromUtf8(isolate(), s, v8::NewStringType::kNo rmal), source)) {
154 ADD_FAILURE(); 155 ADD_FAILURE();
155 return ScriptValue(); 156 return ScriptValue();
156 } 157 }
157 if (!v8Call(v8::Script::Compile(getScriptState()->context(), source), sc ript)) { 158 if (!v8Call(v8::Script::Compile(getScriptState()->context(), source), sc ript)) {
158 ADD_FAILURE() << "Compilation fails"; 159 ADD_FAILURE() << "Compilation fails";
159 return ScriptValue(); 160 return ScriptValue();
160 } 161 }
161 return ScriptValue(getScriptState(), script->Run(getScriptState()->conte xt())); 162 return ScriptValue(getScriptState(), script->Run(getScriptState()->conte xt()));
162 } 163 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 332
332 EXPECT_TRUE(it3->isSet()); 333 EXPECT_TRUE(it3->isSet());
333 EXPECT_TRUE(it3->isValid()); 334 EXPECT_TRUE(it3->isValid());
334 EXPECT_TRUE(it3->isDone()); 335 EXPECT_TRUE(it3->isDone());
335 } 336 }
336 337
337 } // namespace 338 } // namespace
338 339
339 } // namespace blink 340 } // namespace blink
340 341
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698