Title: [141094] trunk
Revision
141094
Author
[email protected]
Date
2013-01-29 03:55:43 -0800 (Tue, 29 Jan 2013)

Log Message

Web Inspector: [CPU Profile] Taking profile crashes renderer.
https://bugs.webkit.org/show_bug.cgi?id=108072

Patch by Eugene Klyuchnikov <[email protected]> on 2013-01-29
Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: inspector/profiler/cpu-profiler-agent-crash-on-start.html

Fixed null-pointer access.

* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::start): Fixed null-pointer access.
(WebCore::ScriptProfiler::stop): Ditto.

LayoutTests:

Added test to check that ProfilerAgent start/stop doesn't crash.

* inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt: Added.
* inspector/profiler/cpu-profiler-agent-crash-on-start.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141093 => 141094)


--- trunk/LayoutTests/ChangeLog	2013-01-29 11:36:30 UTC (rev 141093)
+++ trunk/LayoutTests/ChangeLog	2013-01-29 11:55:43 UTC (rev 141094)
@@ -1,3 +1,15 @@
+2013-01-29  Eugene Klyuchnikov  <[email protected]>
+
+        Web Inspector: [CPU Profile] Taking profile crashes renderer.
+        https://bugs.webkit.org/show_bug.cgi?id=108072
+
+        Reviewed by Yury Semikhatsky.
+
+        Added test to check that ProfilerAgent start/stop doesn't crash.
+
+        * inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt: Added.
+        * inspector/profiler/cpu-profiler-agent-crash-on-start.html: Added.
+
 2013-01-29  Allan Sandfeld Jensen  <[email protected]>
 
         REGRESSION: ChildrenAffectedBy flags lost between siblings which have child elements sharing style

Added: trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt (0 => 141094)


--- trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt	2013-01-29 11:55:43 UTC (rev 141094)
@@ -0,0 +1,6 @@
+Test that ProfilerAgent start/stop doesn't crash.
+
+ProfilerAgent started.
+ProfilerAgent stopped.
+ProfilerAgent cleared.
+

Added: trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start.html (0 => 141094)


--- trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/profiler/cpu-profiler-agent-crash-on-start.html	2013-01-29 11:55:43 UTC (rev 141094)
@@ -0,0 +1,39 @@
+<html>
+<head>
+  <script src=""
+<script>
+
+function test()
+{
+    WebInspector.showPanel("profiles");
+    ProfilerAgent.start(onStart);
+
+    function onStart()
+    {
+        InspectorTest.addResult("ProfilerAgent started.");
+        ProfilerAgent.stop(onStop);
+    }
+
+    function onStop()
+    {
+        InspectorTest.addResult("ProfilerAgent stopped.");
+        ProfilerAgent.clearProfiles(done);
+    }
+
+    function done()
+    {
+        InspectorTest.addResult("ProfilerAgent cleared.");
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Test that ProfilerAgent start/stop doesn't crash.
+</p>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (141093 => 141094)


--- trunk/Source/WebCore/ChangeLog	2013-01-29 11:36:30 UTC (rev 141093)
+++ trunk/Source/WebCore/ChangeLog	2013-01-29 11:55:43 UTC (rev 141094)
@@ -1,3 +1,18 @@
+2013-01-29  Eugene Klyuchnikov  <[email protected]>
+
+        Web Inspector: [CPU Profile] Taking profile crashes renderer.
+        https://bugs.webkit.org/show_bug.cgi?id=108072
+
+        Reviewed by Yury Semikhatsky.
+
+        Test: inspector/profiler/cpu-profiler-agent-crash-on-start.html
+
+        Fixed null-pointer access.
+
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::start): Fixed null-pointer access.
+        (WebCore::ScriptProfiler::stop): Ditto.
+
 2013-01-29  Allan Sandfeld Jensen  <[email protected]>
 
         REGRESSION: ChildrenAffectedBy flags lost between siblings which have child elements sharing style

Modified: trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp (141093 => 141094)


--- trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2013-01-29 11:36:30 UTC (rev 141093)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2013-01-29 11:55:43 UTC (rev 141094)
@@ -59,7 +59,7 @@
     profileNameIdleTimeMap->add(title, 0);
 
     v8::HandleScope hs;
-    v8::CpuProfiler::StartProfiling(v8String(title, state->isolate()));
+    v8::CpuProfiler::StartProfiling(v8String(title, v8::Isolate::GetCurrent()));
 }
 
 void ScriptProfiler::startForPage(Page*, const String& title)
@@ -78,8 +78,8 @@
 {
     v8::HandleScope hs;
     const v8::CpuProfile* profile = "" ?
-        v8::CpuProfiler::StopProfiling(v8String(title, state->isolate()), state->context()->GetSecurityToken()) :
-        v8::CpuProfiler::StopProfiling(v8String(title, state->isolate()));
+        v8::CpuProfiler::StopProfiling(v8String(title, v8::Isolate::GetCurrent()), state->context()->GetSecurityToken()) :
+        v8::CpuProfiler::StopProfiling(v8String(title, v8::Isolate::GetCurrent()));
     if (!profile)
         return 0;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to