From 8ce1943be5284c67fb79cae9bf1576624fba97b6 Mon Sep 17 00:00:00 2001 From: dgozman Date: Wed, 16 Mar 2016 15:30:50 -0700 Subject: Remove V8RecrusionScope, cleanup call sites. - blink-side usages migrated to v8::MicrotasksScope; - clients of WebScopedMicrotaskSuppression migrated to v8::MicrotasksScope; - moved Microtask.{h,cpp} to bindings/core/v8; - removed extra wrappers from V8DebuggerClient; - fixed a couple of inspector tests which relied on trace event not emitted from debugger anymore. Attempt #2. First one failed due to missing scopes in platform/v8_inspector. See issue 594974. BUG=585949 Review URL: https://codereview.chromium.org/1769273004 Cr-Commit-Position: refs/heads/master@{#381569} --- chrome/test/base/v8_unit_test.cc | 10 ++- .../guest_view/renderer/guest_view_container.cc | 6 +- .../guest_view/renderer/guest_view_request.cc | 4 +- content/child/v8_value_converter_impl_unittest.cc | 22 +++-- .../gin_java_bridge_value_converter_unittest.cc | 4 +- .../renderer/pepper/v8_var_converter_unittest.cc | 4 +- .../activity_log_converter_strategy_unittest.cc | 4 +- .../guest_view/extensions_guest_view_container.cc | 4 +- extensions/renderer/messaging_bindings.cc | 1 - extensions/renderer/module_system.cc | 1 - extensions/renderer/safe_builtins.cc | 4 +- extensions/renderer/script_context.cc | 7 +- extensions/renderer/utils_native_handler.cc | 1 - extensions/renderer/v8_helpers.h | 4 +- .../http/tests/inspector/timeline-test.js | 7 ++ .../timeline/fetch-as-stream.html | 1 - .../WebKit/LayoutTests/inspector/tracing.html | 1 - .../tracing/timeline-bound-function-expected.txt | 1 - .../timeline-injected-script-eval-expected.txt | 18 +--- .../tracing/timeline-injected-script-eval.html | 2 +- .../inspector/tracing/timeline-layout.html | 4 +- .../timeline-recalculate-styles-expected.txt | 4 +- .../tracing/timeline-recalculate-styles.html | 7 +- .../timeline-receive-response-event-expected.txt | 2 +- .../tracing/timeline-script-id-expected.txt | 1 - .../inspector/tracing/timeline-time-expected.txt | 10 +-- .../inspector/tracing/timeline-timer-expected.txt | 13 --- .../WebKit/Source/bindings/core/v8/Microtask.cpp | 62 ++++++++++++++ .../WebKit/Source/bindings/core/v8/Microtask.h | 76 +++++++++++++++++ .../core/v8/ReadableStreamOperationsTest.cpp | 3 +- .../Source/bindings/core/v8/V8ObjectConstructor.h | 5 +- .../Source/bindings/core/v8/V8PerIsolateData.h | 2 +- .../Source/bindings/core/v8/V8RecursionScope.cpp | 35 -------- .../Source/bindings/core/v8/V8RecursionScope.h | 99 ---------------------- .../Source/bindings/core/v8/V8ScriptRunner.cpp | 22 ++--- .../bindings/core/v8/custom/V8WindowCustom.cpp | 1 + third_party/WebKit/Source/bindings/core/v8/v8.gypi | 4 +- third_party/WebKit/Source/core/core.gypi | 2 - third_party/WebKit/Source/core/dom/Document.cpp | 2 +- third_party/WebKit/Source/core/dom/Microtask.cpp | 65 -------------- third_party/WebKit/Source/core/dom/Microtask.h | 58 ------------- .../WebKit/Source/core/dom/MutationObserver.cpp | 2 +- third_party/WebKit/Source/core/dom/Node.cpp | 2 +- .../custom/CustomElementMicrotaskDispatcher.cpp | 2 +- .../dom/custom/CustomElementMicrotaskRunQueue.cpp | 2 +- .../WebKit/Source/core/html/HTMLSlotElement.cpp | 2 +- .../Source/core/html/parser/HTMLScriptRunner.cpp | 2 +- .../WebKit/Source/core/inspector/DevToolsHost.cpp | 3 +- .../Source/core/inspector/ThreadDebugger.cpp | 36 ++------ .../WebKit/Source/core/inspector/ThreadDebugger.h | 6 +- .../WebKit/Source/core/loader/ImageLoader.cpp | 2 +- .../WebKit/Source/core/workers/WorkerThread.cpp | 2 +- .../devtools/front_end/timeline/TimelineUIUtils.js | 8 +- .../fetch/ReadableStreamDataConsumerHandle.cpp | 1 - .../fetch/ReadableStreamDataConsumerHandleTest.cpp | 3 +- .../modules/mediastream/RTCPeerConnection.cpp | 2 +- .../platform/v8_inspector/InjectedScript.cpp | 38 ++++----- .../Source/platform/v8_inspector/InjectedScript.h | 4 +- .../v8_inspector/InjectedScriptManager.cpp | 15 ++-- .../platform/v8_inspector/InjectedScriptManager.h | 3 +- .../platform/v8_inspector/InspectorWrapper.cpp | 5 +- .../platform/v8_inspector/InspectorWrapper.h | 12 ++- .../platform/v8_inspector/JavaScriptCallFrame.cpp | 41 +++++---- .../platform/v8_inspector/JavaScriptCallFrame.h | 11 +-- .../platform/v8_inspector/V8DebuggerImpl.cpp | 70 ++++++++++++--- .../Source/platform/v8_inspector/V8DebuggerImpl.h | 3 + .../platform/v8_inspector/V8FunctionCall.cpp | 7 +- .../Source/platform/v8_inspector/V8FunctionCall.h | 6 +- .../platform/v8_inspector/V8InjectedScriptHost.cpp | 9 +- .../platform/v8_inspector/V8InjectedScriptHost.h | 2 +- .../v8_inspector/V8JavaScriptCallFrame.cpp | 6 +- .../platform/v8_inspector/V8JavaScriptCallFrame.h | 2 +- .../Source/platform/v8_inspector/V8Regex.cpp | 4 +- .../v8_inspector/public/V8DebuggerClient.h | 8 +- third_party/WebKit/Source/web/WebKit.cpp | 2 +- .../Source/web/WebScopedMicrotaskSuppression.cpp | 63 -------------- third_party/WebKit/Source/web/web.gypi | 1 - third_party/WebKit/public/blink_headers.gypi | 1 - .../public/web/WebScopedMicrotaskSuppression.h | 76 ----------------- 79 files changed, 394 insertions(+), 653 deletions(-) create mode 100644 third_party/WebKit/Source/bindings/core/v8/Microtask.cpp create mode 100644 third_party/WebKit/Source/bindings/core/v8/Microtask.h delete mode 100644 third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.cpp delete mode 100644 third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.h delete mode 100644 third_party/WebKit/Source/core/dom/Microtask.cpp delete mode 100644 third_party/WebKit/Source/core/dom/Microtask.h delete mode 100644 third_party/WebKit/Source/web/WebScopedMicrotaskSuppression.cpp delete mode 100644 third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h diff --git a/chrome/test/base/v8_unit_test.cc b/chrome/test/base/v8_unit_test.cc index 392ff45..80ac9fb 100644 --- a/chrome/test/base/v8_unit_test.cc +++ b/chrome/test/base/v8_unit_test.cc @@ -11,7 +11,6 @@ #include "base/strings/stringprintf.h" #include "chrome/common/chrome_paths.h" #include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" namespace { @@ -96,7 +95,8 @@ bool V8UnitTest::RunJavascriptTestF(const std::string& test_fixture, v8::Local context = v8::Local::New(isolate, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local function_property = context->Global()->Get(v8::String::NewFromUtf8(isolate, "runTest")); @@ -211,7 +211,8 @@ void V8UnitTest::ExecuteScriptInContext(const base::StringPiece& script_source, v8::Local context = v8::Local::New(isolate, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local source = v8::String::NewFromUtf8(isolate, script_source.data(), @@ -260,7 +261,8 @@ void V8UnitTest::TestFunction(const std::string& function_name) { v8::Local context = v8::Local::New(isolate, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local function_property = context->Global()->Get( v8::String::NewFromUtf8(isolate, function_name.c_str())); diff --git a/components/guest_view/renderer/guest_view_container.cc b/components/guest_view/renderer/guest_view_container.cc index c410c6f..4d8df38 100644 --- a/components/guest_view/renderer/guest_view_container.cc +++ b/components/guest_view/renderer/guest_view_container.cc @@ -11,7 +11,6 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_view.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" namespace { @@ -154,7 +153,7 @@ void GuestViewContainer::HandlePendingResponseCallback( void GuestViewContainer::RunDestructionCallback(bool embedder_frame_destroyed) { // Do not attempt to run |destruction_callback_| if the embedder frame was // destroyed. Trying to invoke callback on RenderFrame destruction results in - // assertion failure when calling WebScopedMicrotaskSuppression. + // assertion failure when calling v8::MicrotasksScope. if (embedder_frame_destroyed) return; @@ -168,7 +167,8 @@ void GuestViewContainer::RunDestructionCallback(bool embedder_frame_destroyed) { return; v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression suppression; + v8::MicrotasksScope microtasks( + destruction_isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); callback->Call(context->Global(), 0 /* argc */, nullptr); } diff --git a/components/guest_view/renderer/guest_view_request.cc b/components/guest_view/renderer/guest_view_request.cc index d0aa061..fead0c5 100644 --- a/components/guest_view/renderer/guest_view_request.cc +++ b/components/guest_view/renderer/guest_view_request.cc @@ -13,7 +13,6 @@ #include "content/public/renderer/render_view.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebRemoteFrame.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "third_party/WebKit/public/web/WebView.h" namespace guest_view { @@ -43,7 +42,8 @@ void GuestViewRequest::ExecuteCallbackIfAvailable( return; v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression suppression; + v8::MicrotasksScope microtasks( + isolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); callback->Call(context->Global(), argc, argv.get()); } diff --git a/content/child/v8_value_converter_impl_unittest.cc b/content/child/v8_value_converter_impl_unittest.cc index 435ea30..ccb1db5 100644 --- a/content/child/v8_value_converter_impl_unittest.cc +++ b/content/child/v8_value_converter_impl_unittest.cc @@ -14,7 +14,6 @@ #include "base/values.h" #include "content/child/v8_value_converter_impl.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" namespace content { @@ -288,7 +287,8 @@ TEST_F(V8ValueConverterImplTest, ObjectExceptions) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); // Set up objects to throw when reading or writing 'foo'. const char* source = @@ -331,7 +331,8 @@ TEST_F(V8ValueConverterImplTest, ArrayExceptions) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" "var arr = [];" @@ -408,7 +409,8 @@ TEST_F(V8ValueConverterImplTest, Prototype) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" "Object.prototype.foo = 'foo';" @@ -433,7 +435,8 @@ TEST_F(V8ValueConverterImplTest, StripNullFromObjects) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" "return { foo: undefined, bar: null };" @@ -492,7 +495,8 @@ TEST_F(V8ValueConverterImplTest, WeirdProperties) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" "return {" @@ -531,7 +535,8 @@ TEST_F(V8ValueConverterImplTest, ArrayGetters) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" "var a = [0];" @@ -556,7 +561,8 @@ TEST_F(V8ValueConverterImplTest, UndefinedValueBehavior) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local object; { diff --git a/content/renderer/java/gin_java_bridge_value_converter_unittest.cc b/content/renderer/java/gin_java_bridge_value_converter_unittest.cc index 2178fca..33c3222 100644 --- a/content/renderer/java/gin_java_bridge_value_converter_unittest.cc +++ b/content/renderer/java/gin_java_bridge_value_converter_unittest.cc @@ -12,7 +12,6 @@ #include "content/common/android/gin_java_bridge_value.h" #include "content/renderer/java/gin_java_bridge_value_converter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" namespace content { @@ -100,7 +99,8 @@ TEST_F(GinJavaBridgeValueConverterTest, TypedArrays) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks_scope( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); scoped_ptr converter( new GinJavaBridgeValueConverter()); diff --git a/content/renderer/pepper/v8_var_converter_unittest.cc b/content/renderer/pepper/v8_var_converter_unittest.cc index e030ffd..283aad6 100644 --- a/content/renderer/pepper/v8_var_converter_unittest.cc +++ b/content/renderer/pepper/v8_var_converter_unittest.cc @@ -29,7 +29,6 @@ #include "ppapi/shared_impl/var.h" #include "ppapi/shared_impl/var_tracker.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" using ppapi::ArrayBufferVar; @@ -404,7 +403,8 @@ TEST_F(V8VarConverterTest, StrangeDictionaryKeyTest) { v8::Local context = v8::Local::New(isolate_, context_); v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); const char* source = "(function() {" diff --git a/extensions/renderer/activity_log_converter_strategy_unittest.cc b/extensions/renderer/activity_log_converter_strategy_unittest.cc index aa80447..fbb9597 100644 --- a/extensions/renderer/activity_log_converter_strategy_unittest.cc +++ b/extensions/renderer/activity_log_converter_strategy_unittest.cc @@ -6,7 +6,6 @@ #include "base/values.h" #include "extensions/renderer/activity_log_converter_strategy.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" using content::V8ValueConverter; @@ -123,7 +122,8 @@ TEST_F(ActivityLogConverterStrategyTest, ConversionTest) { "};" "})();"; - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local script( v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source))); v8::Local v8_object = script->Run().As(); diff --git a/extensions/renderer/guest_view/extensions_guest_view_container.cc b/extensions/renderer/guest_view/extensions_guest_view_container.cc index 3fa9882..ffa3580 100644 --- a/extensions/renderer/guest_view/extensions_guest_view_container.cc +++ b/extensions/renderer/guest_view/extensions_guest_view_container.cc @@ -5,7 +5,6 @@ #include "extensions/renderer/guest_view/extensions_guest_view_container.h" #include "content/public/renderer/render_frame.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "ui/gfx/geometry/size.h" namespace extensions { @@ -56,7 +55,8 @@ void ExtensionsGuestViewContainer::CallElementResizeCallback( v8::Integer::New(element_resize_isolate_, new_size.height())}; v8::Context::Scope context_scope(context); - blink::WebScopedMicrotaskSuppression suppression; + v8::MicrotasksScope microtasks( + element_resize_isolate_, v8::MicrotasksScope::kDoNotRunMicrotasks); callback->Call(context->Global(), argc, argv); } diff --git a/extensions/renderer/messaging_bindings.cc b/extensions/renderer/messaging_bindings.cc index 722bc72..0d87c4c 100644 --- a/extensions/renderer/messaging_bindings.cc +++ b/extensions/renderer/messaging_bindings.cc @@ -35,7 +35,6 @@ #include "extensions/renderer/v8_helpers.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "third_party/WebKit/public/web/WebScopedUserGesture.h" #include "third_party/WebKit/public/web/WebScopedWindowFocusAllowedIndicator.h" #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc index 4ca689a..692939e 100644 --- a/extensions/renderer/module_system.cc +++ b/extensions/renderer/module_system.cc @@ -22,7 +22,6 @@ #include "extensions/renderer/v8_helpers.h" #include "gin/modules/module_registry.h" #include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" namespace extensions { diff --git a/extensions/renderer/safe_builtins.cc b/extensions/renderer/safe_builtins.cc index 3a66eaf..fbd88bd 100644 --- a/extensions/renderer/safe_builtins.cc +++ b/extensions/renderer/safe_builtins.cc @@ -9,7 +9,6 @@ #include "base/strings/stringprintf.h" #include "extensions/renderer/script_context.h" #include "extensions/renderer/v8_helpers.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" namespace extensions { @@ -201,7 +200,8 @@ class ExtensionImpl : public v8::Extension { return; } - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks( + info.GetIsolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local return_value; if (function->Call(context, recv, argc, argv.get()).ToLocal(&return_value)) info.GetReturnValue().Set(return_value); diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc index f6f47f3..4bcec51 100644 --- a/extensions/renderer/script_context.cc +++ b/extensions/renderer/script_context.cc @@ -29,7 +29,6 @@ #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "third_party/WebKit/public/web/WebView.h" #include "v8/include/v8.h" @@ -185,7 +184,8 @@ v8::Local ScriptContext::CallFunction( v8::EscapableHandleScope handle_scope(isolate()); v8::Context::Scope scope(v8_context()); - blink::WebScopedMicrotaskSuppression suppression; + v8::MicrotasksScope microtasks( + isolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); if (!is_valid_) { return handle_scope.Escape( v8::Local(v8::Undefined(isolate()))); @@ -434,7 +434,8 @@ v8::Local ScriptContext::RunScript( return v8::Undefined(isolate()); } - blink::WebScopedMicrotaskSuppression suppression; + v8::MicrotasksScope microtasks( + isolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); v8::TryCatch try_catch(isolate()); try_catch.SetCaptureMessage(true); v8::ScriptOrigin origin( diff --git a/extensions/renderer/utils_native_handler.cc b/extensions/renderer/utils_native_handler.cc index d93f2e6..1ded40c 100644 --- a/extensions/renderer/utils_native_handler.cc +++ b/extensions/renderer/utils_native_handler.cc @@ -7,7 +7,6 @@ #include "base/macros.h" #include "base/strings/stringprintf.h" #include "extensions/renderer/script_context.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" namespace extensions { diff --git a/extensions/renderer/v8_helpers.h b/extensions/renderer/v8_helpers.h index b0dd17a..0a3b2eb 100644 --- a/extensions/renderer/v8_helpers.h +++ b/extensions/renderer/v8_helpers.h @@ -9,7 +9,6 @@ #include #include "base/strings/string_number_conversions.h" -#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "v8/include/v8.h" namespace extensions { @@ -156,7 +155,8 @@ inline bool CallFunction(v8::Local context, int argc, v8::Local argv[], v8::Local* out) { - blink::WebScopedMicrotaskSuppression microtasks_scope; + v8::MicrotasksScope microtasks_scope( + context->GetIsolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); return function->Call(context, recv, argc, argv).ToLocal(out); } diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js index 6b13a87..cc148cc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js @@ -1,3 +1,10 @@ +function wrapCallFunctionForTimeline(f) +{ + var script = document.createElement("script"); + script.textContent = "(" + f.toString() + ")()\n//# sourceURL=wrapCallFunctionForTimeline.js"; + document.body.appendChild(script); +} + var initialize_Timeline = function() { InspectorTest.preloadPanel("timeline"); diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/timeline/fetch-as-stream.html b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/fetch-as-stream.html index 4f0e1d4..6c11d72 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/timeline/fetch-as-stream.html +++ b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/fetch-as-stream.html @@ -93,7 +93,6 @@ function test() ++knownEvents[event.name]; } assertGreaterOrEqual(events.length, 10, "Too few trace events recorded"); - assertGreaterOrEqual(knownEvents["FunctionCall"], 1, "Too few FunctionCall events"); assertGreaterOrEqual(knownEvents["UpdateLayoutTree"], 1, "Too few UpdateLayoutTree events"); assertGreaterOrEqual(knownEvents["Layout"], 1, "Too few Layout events"); InspectorTest.log("Event sanity test done"); diff --git a/third_party/WebKit/LayoutTests/inspector/tracing.html b/third_party/WebKit/LayoutTests/inspector/tracing.html index c7ee50d..c0fb911 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing.html @@ -91,7 +91,6 @@ function test() ++knownEvents[event.name]; } InspectorTest.assertGreaterOrEqual(events.length, 100, "Too few trace events recorded"); - InspectorTest.assertGreaterOrEqual(knownEvents["v8.callFunction"], 1, "Too few v8.callFunction"); InspectorTest.assertGreaterOrEqual(knownEvents["UpdateLayoutTree"], 1, "Too few UpdateLayoutTree"); InspectorTest.assertGreaterOrEqual(knownEvents["FrameView::layout"], 1, "Too few FrameView::layout"); InspectorTest.assertGreaterOrEqual(phaseComplete, 50, "Too few begin events"); diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-bound-function-expected.txt b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-bound-function-expected.txt index c8f5b5d..4151574 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-bound-function-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-bound-function-expected.txt @@ -1,6 +1,5 @@ Tests extracting information about original functions from bound ones -FunctionCall :1 FunctionCall timeline-bound-function.html:7 diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval-expected.txt b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval-expected.txt index 63be6e9..4fa0644 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval-expected.txt @@ -1,17 +1 @@ -Tests the Timeline API function call record for InjectedScript.eval call feature. - -FunctionCall Properties: -{ - data : { - frame : - scriptId : - scriptLine : - scriptName : - } - endTime : - frameId : - startTime : - type : "FunctionCall" -} -Text details for FunctionCall: undefined - +Tests the Timeline API function call is not recorded for InjectedScript.eval. diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval.html index 6fa62fa..9fd6787 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-injected-script-eval.html @@ -19,7 +19,7 @@ function test()

-Tests the Timeline API function call record for InjectedScript.eval call feature. +Tests the Timeline API function call is not recorded for InjectedScript.eval.

diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout.html index bf7ebbf..7c2ed83 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout.html @@ -19,8 +19,8 @@ function invalidateAndForceLayout(element) function performActions() { - invalidateAndForceLayout(document.getElementById("invalidate1")); - invalidateAndForceLayout(document.getElementById("invalidate2")); + wrapCallFunctionForTimeline(() => invalidateAndForceLayout(document.getElementById("invalidate1"))); + wrapCallFunctionForTimeline(() => invalidateAndForceLayout(document.getElementById("invalidate2"))); } function test() diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles-expected.txt b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles-expected.txt index dafad285..e3dd2b4 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles-expected.txt @@ -8,7 +8,7 @@ UpdateLayoutTree Properties: frame : stackTrace : } - elementCount : 2 + elementCount : 3 } endTime : frameId : @@ -16,6 +16,6 @@ UpdateLayoutTree Properties: startTime : type : "UpdateLayoutTree" } -Text details for UpdateLayoutTree: timeline-recalculate-styles.html:20 +Text details for UpdateLayoutTree: wrapCallFunctionForTimeline.js:8 UpdateLayoutTree has a warning diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles.html index df024b8..1458e25 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-recalculate-styles.html @@ -11,7 +11,7 @@