[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:49:36 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit e74e2e6e00897f552a3287f0233c47d18b226558
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 21 13:57:12 2009 +0000

    2009-10-21  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Enable creation of custom SidebarTreeElements for different ProfileTypes
    
            ProfileTypes can now create sidebar tree elements of custom types.
            https://bugs.webkit.org/show_bug.cgi?id=30520
    
            * inspector/front-end/ProfileView.js:
            (WebInspector.CPUProfileType.prototype.setRecordingProfile):
            (WebInspector.CPUProfileType.prototype.createSidebarTreeElementForProfile):
            (WebInspector.CPUProfileType.prototype.createView):
            (WebInspector.CPUProfile.prototype.get head):
            * inspector/front-end/ProfilesPanel.js:
            (WebInspector.ProfileType.prototype.buttonClicked):
            (WebInspector.ProfileType.prototype.viewForProfile):
            (WebInspector.ProfileType.prototype.createView):
            (WebInspector.ProfileType.prototype.createSidebarTreeElementForProfile):
            (WebInspector.ProfilesPanel.prototype.addProfileHeader):
            (WebInspector.ProfilesPanel.prototype.showProfile):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2deab4a..cf0e6ba 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-21  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Enable creation of custom SidebarTreeElements for different ProfileTypes
+
+        ProfileTypes can now create sidebar tree elements of custom types.
+        https://bugs.webkit.org/show_bug.cgi?id=30520
+
+        * inspector/front-end/ProfileView.js:
+        (WebInspector.CPUProfileType.prototype.setRecordingProfile):
+        (WebInspector.CPUProfileType.prototype.createSidebarTreeElementForProfile):
+        (WebInspector.CPUProfileType.prototype.createView):
+        (WebInspector.CPUProfile.prototype.get head):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfileType.prototype.buttonClicked):
+        (WebInspector.ProfileType.prototype.viewForProfile):
+        (WebInspector.ProfileType.prototype.createView):
+        (WebInspector.ProfileType.prototype.createSidebarTreeElementForProfile):
+        (WebInspector.ProfilesPanel.prototype.addProfileHeader):
+        (WebInspector.ProfilesPanel.prototype.showProfile):
+
 2009-10-20  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/inspector/front-end/ProfileView.js b/WebCore/inspector/front-end/ProfileView.js
index ee96345..afced41 100644
--- a/WebCore/inspector/front-end/ProfileView.js
+++ b/WebCore/inspector/front-end/ProfileView.js
@@ -602,6 +602,16 @@ WebInspector.CPUProfileType.prototype = {
     setRecordingProfile: function(isProfiling)
     {
         this._recording = isProfiling;
+    },
+
+    createSidebarTreeElementForProfile: function(profile)
+    {
+        return new WebInspector.ProfileSidebarTreeElement(profile);
+    },
+
+    createView: function(profile)
+    {
+        return new WebInspector.CPUProfileView(profile);
     }
 }
 
@@ -627,18 +637,5 @@ WebInspector.CPUProfile.prototype = {
     get head()
     {
         return this.representedObject.head;
-    },
-
-    createView: function()
-    {
-        return new WebInspector.CPUProfileView(this);
-    },
-
-    // FIXME: Extract this into a superclass so that createView can be simply overridden by subclasses.
-    viewForProfile: function()
-    {
-        if (!this._profileView)
-            this._profileView = this.createView();
-        return this._profileView;
     }
 }
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index 55e286e..a5a354e 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -61,6 +61,25 @@ WebInspector.ProfileType.prototype = {
 
     buttonClicked: function()
     {
+    },
+
+    viewForProfile: function(profile)
+    {
+        if (!profile._profileView)
+            profile._profileView = this.createView(profile);
+        return profile._profileView;
+    },
+
+    // Must be implemented by subclasses.
+    createView: function(profile)
+    {
+        throw new Error("Needs implemented.");
+    },
+
+    // Must be implemented by subclasses.
+    createSidebarTreeElementForProfile: function(profile)
+    {
+        throw new Error("Needs implemented.");
     }
 }
 
@@ -212,10 +231,12 @@ WebInspector.ProfilesPanel.prototype = {
 
     addProfileHeader: function(typeId, profile)
     {
-        var sidebarParent = this.getProfileType(typeId).treeElement;
+        var profileType = this.getProfileType(typeId);
+        var sidebarParent = profileType.treeElement;
         var small = false;
         var alternateTitle;
 
+        profile.__profilesPanelProfileType = profileType;
         this._profiles.push(profile);
         this._profilesIdMap[this._makeKey(profile.uid, typeId)] = profile;
 
@@ -257,7 +278,7 @@ WebInspector.ProfilesPanel.prototype = {
             }
         }
 
-        var profileTreeElement = new WebInspector.ProfileSidebarTreeElement(profile);
+        var profileTreeElement = profileType.createSidebarTreeElementForProfile(profile);
         profileTreeElement.small = small;
         if (alternateTitle)
             profileTreeElement.mainTitle = alternateTitle;
@@ -276,7 +297,7 @@ WebInspector.ProfilesPanel.prototype = {
         if (this.visibleView)
             this.visibleView.hide();
 
-        var view = profile.viewForProfile();
+        var view = profile.__profilesPanelProfileType.viewForProfile(profile);
 
         view.show(this.profileViews);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list