Web Inspector: Remove console.profiles from window.console API
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Feb 2014 19:34:34 +0000 (19:34 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Feb 2014 19:34:34 +0000 (19:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116883

Reviewed by Timothy Hatcher.

Source/WebCore:

console.profiles has been removed or never implemented by other
browsers. We should remove it as well. However, since tests
rely on it, keep it as window.internals.consoleProfiles.

* WebCore.exp.in:
* page/Console.idl:
* testing/Internals.cpp:
(WebCore::Internals::consoleProfiles):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

LayoutTests:

* fast/profiler/resources/profiler-test-JS-resources.js:
(printHeavyProfilesDataWithoutTime):
(printProfilesDataWithoutTime):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Console.idl
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebinspector.cpp

index fdc6853..130fe1c 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove console.profiles from window.console API
+        https://bugs.webkit.org/show_bug.cgi?id=116883
+
+        Reviewed by Timothy Hatcher.
+
+        * fast/profiler/resources/profiler-test-JS-resources.js:
+        (printHeavyProfilesDataWithoutTime):
+        (printProfilesDataWithoutTime):
+
 2014-02-26  Sergio Villar Senin  <svillar@igalia.com>
 
         [CSS Grid Layout] Check default getComputedStyle() return values for grid properties
index 4fd5a05..d67d4ba 100644 (file)
@@ -49,7 +49,7 @@ function printHeavyProfilesDataWithoutTime()
     var preElement = document.createElement("pre");
     preElement.appendChild(document.createTextNode("\n"));
 
-    var profiles = console.profiles;
+    var profiles = internals.consoleProfiles;
     for (var i = 0; i < profiles.length; ++i) {
         preElement.appendChild(document.createTextNode("Profile title: " + profiles[i].title + "\n"));
         printProfileNodeWithoutTime(preElement, profiles[i].heavyProfile.head, 0);
@@ -64,7 +64,7 @@ function printProfilesDataWithoutTime()
     var preElement = document.createElement("pre");
     preElement.appendChild(document.createTextNode("\n"));
 
-    var profiles = console.profiles;
+    var profiles = internals.consoleProfiles;
     for (var i = 0; i < profiles.length; ++i) {
         preElement.appendChild(document.createTextNode("Profile title: " + profiles[i].title + "\n"));
         printProfileNodeWithoutTime(preElement, profiles[i].head, 0);
index 7329d7b..04bdc16 100644 (file)
@@ -1,3 +1,21 @@
+2014-02-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove console.profiles from window.console API
+        https://bugs.webkit.org/show_bug.cgi?id=116883
+
+        Reviewed by Timothy Hatcher.
+
+        console.profiles has been removed or never implemented by other
+        browsers. We should remove it as well. However, since tests
+        rely on it, keep it as window.internals.consoleProfiles.
+
+        * WebCore.exp.in:
+        * page/Console.idl:
+        * testing/Internals.cpp:
+        (WebCore::Internals::consoleProfiles):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2014-02-26  Martin Hock  <mhock@apple.com>
 
         Create SessionID value-style class for session IDs.
index c209e1d..6731585 100644 (file)
@@ -1078,6 +1078,7 @@ __ZN7WebCore4coreEP20NSURLProtectionSpace
 __ZN7WebCore4coreEP28NSURLAuthenticationChallenge
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_13DOMStringListE
+__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_13ScriptProfileE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_14ClientRectListE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
@@ -1869,6 +1870,7 @@ __ZNK7WebCore8Settings18standardFontFamilyE11UScriptCode
 __ZNK7WebCore8Settings19sansSerifFontFamilyE11UScriptCode
 __ZNK7WebCore8Settings20pictographFontFamilyE11UScriptCode
 __ZNK7WebCore9DOMWindow27pendingUnloadEventListenersEv
+__ZNK7WebCore9DOMWindow7consoleEv
 __ZNK7WebCore9FloatQuad11boundingBoxEv
 __ZNK7WebCore9FloatRect10intersectsERKS0_
 __ZNK7WebCore9FloatRectcv6CGRectEv
index 90ad10a..ad45188 100644 (file)
     [CallWith=ScriptArguments&ScriptState, ImplementedAs=assertCondition] void assert(boolean condition);
     [CallWith=ScriptArguments&ScriptState] void count();
 
-    // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
-    // "Sequences must not be used as the type of an attribute, constant or exception field."
-    // FIXME: this will lead to BUG console.profiles !== console.profiles as profile will always returns new array.
-    readonly attribute ScriptProfile[] profiles;
     [CallWith=ScriptState] void profile([TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString title);
     [CallWith=ScriptState] void profileEnd([TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString title);
 
index b573450..51d4ccc 100644 (file)
@@ -36,6 +36,7 @@
 #include "ChromeClient.h"
 #include "ClientRect.h"
 #include "ClientRectList.h"
+#include "Console.h"
 #include "ContentDistributor.h"
 #include "Cursor.h"
 #include "DOMStringList.h"
@@ -1435,6 +1436,11 @@ void Internals::toggleOverwriteModeEnabled(ExceptionCode&)
     document->frame()->editor().toggleOverwriteModeEnabled();
 }
 
+const ProfilesArray& Internals::consoleProfiles() const
+{
+    return contextDocument()->domWindow()->console()->profiles();
+}
+
 #if ENABLE(INSPECTOR)
 unsigned Internals::numberOfLiveNodes() const
 {
index 2c42da7..f43846b 100644 (file)
@@ -50,17 +50,19 @@ class Element;
 class Frame;
 class InspectorFrontendChannelDummy;
 class InternalSettings;
+class MallocStatistics;
 class MemoryInfo;
 class Node;
 class Page;
 class Range;
 class ScriptExecutionContext;
-class MallocStatistics;
+class ScriptProfile;
 class SerializedScriptValue;
 class TimeRanges;
 class TypeConversions;
 
 typedef int ExceptionCode;
+typedef Vector<RefPtr<ScriptProfile>> ProfilesArray;
 
 class Internals : public RefCounted<Internals>
                 , public ContextDestructionObserver {
@@ -222,6 +224,8 @@ public:
     void insertAuthorCSS(const String&, ExceptionCode&) const;
     void insertUserCSS(const String&, ExceptionCode&) const;
 
+    const ProfilesArray& consoleProfiles() const;
+
 #if ENABLE(INSPECTOR)
     unsigned numberOfLiveNodes() const;
     unsigned numberOfLiveDocuments() const;
index 505475f..53051f7 100644 (file)
     [RaisesException] void setDeviceProximity(DOMString eventType, double value, double min, double max);
 #endif
 
+    // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
+    // "Sequences must not be used as the type of an attribute, constant or exception field."
+    // FIXME: this will lead to BUG interals.consoleProfiles !== interals.consoleProfiles as profile will always returns new array.
+    readonly attribute ScriptProfile[] consoleProfiles;
+
     [Conditional=INSPECTOR] unsigned long numberOfLiveNodes();
     [Conditional=INSPECTOR] unsigned long numberOfLiveDocuments();
     [Conditional=INSPECTOR] sequence<DOMString> consoleMessageArgumentCounts();
index 6583fa8..7c485dd 100644 (file)
@@ -1,3 +1,12 @@
+2014-02-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove console.profiles from window.console API
+        https://bugs.webkit.org/show_bug.cgi?id=116883
+
+        Reviewed by Timothy Hatcher.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
 2014-02-24  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
index d49a9c6..9ee5f9a 100644 (file)
@@ -357,6 +357,8 @@ EXPORTS
         symbolWithPointer(?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@PBDH@Z, ?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PEAVFrame@2@PEBDH@Z)
         symbolWithPointer(?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@HHHHHHH@Z, ?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PEAVFrame@2@HHHHHHH@Z)
         symbolWithPointer(?close@DOMWindow@WebCore@@QAEXPAVScriptExecutionContext@2@@Z, ?close@DOMWindow@WebCore@@QEAAXPEAVScriptExecutionContext@2@@Z)
+        symbolWithPointer(?console@DOMWindow@WebCore@@QBEPAVConsole@2@XZ, ?console@DOMWindow@WebCore@@QBEPAVConsole@2@XZ)
+        symbolWithPointer(?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVScriptProfile@1@@Z, ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVScriptProfile@1@@Z)
         symbolWithPointer(?document@DOMWindow@WebCore@@QBEPAVDocument@2@XZ, ?document@DOMWindow@WebCore@@QEBAPEAVDocument@2@XZ)
         symbolWithPointer(?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0AAV12@2@Z, ?open@DOMWindow@WebCore@@QEAA?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@AEBVString@4@AEBVAtomicString@4@0AEAV12@2@Z)
         symbolWithPointer(?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVDOMWindow@1@@Z, ?toJS@WebCore@@YA?AVJSValue@JSC@@PEAVExecState@3@PEAVJSDOMGlobalObject@1@PEAVDOMWindow@1@@Z)
index 1365699..71b3ce2 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-26  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove console.profiles from window.console API
+        https://bugs.webkit.org/show_bug.cgi?id=116883
+
+        Reviewed by Timothy Hatcher.
+
+        * webkit/webkitwebinspector.cpp:
+        (webkit_web_inspector_class_init):
+        Removed stale part of comment.
+
 2014-02-26  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] generate-gtkdoc can fail with WebKit1 or WebKit2 only builds
index fb6ab10..da8d51b 100644 (file)
@@ -292,8 +292,7 @@ static void webkit_web_inspector_class_init(WebKitWebInspectorClass* klass)
     /**
     * WebKitWebInspector:javascript-profiling-enabled:
     *
-    * This is enabling JavaScript profiling in the Inspector. This means
-    * that Console.profiles will return the profiles.
+    * This is enabling JavaScript profiling in the Inspector.
     *
     * Since: 1.1.1
     */