[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yurys at chromium.org
yurys at chromium.org
Wed Dec 22 12:34:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e01358fde5787c365862dd33fffe0c2e519305a2
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 25 14:14:21 2010 +0000
2010-08-25 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: lazily request frontend settings instead of pushing them on connect
https://bugs.webkit.org/show_bug.cgi?id=44607
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createParser):
* inspector/Inspector.idl:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::getSettings):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::populateScriptObjects): this method is now called explicitely from the frontend,
it should be gone eventually once all panels request initial data lazily.
* inspector/InspectorController.h:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype.show):
(WebInspector.ProfilesPanel.prototype.profilerWasEnabled):
(WebInspector.ProfilesPanel.prototype._reset):
* inspector/front-end/Settings.js:
(WebInspector.Settings):
(WebInspector.Settings.initialize.populateApplicationSettings):
(WebInspector.Settings.initialize.populateSessionSettings):
(WebInspector.Settings.initialize):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a4e9525..238dc90 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-08-25 Yury Semikhatsky <yurys at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: lazily request frontend settings instead of pushing them on connect
+ https://bugs.webkit.org/show_bug.cgi?id=44607
+
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::createParser):
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::getSettings):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::populateScriptObjects): this method is now called explicitely from the frontend,
+ it should be gone eventually once all panels request initial data lazily.
+ * inspector/InspectorController.h:
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel.prototype.show):
+ (WebInspector.ProfilesPanel.prototype.profilerWasEnabled):
+ (WebInspector.ProfilesPanel.prototype._reset):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ (WebInspector.Settings.initialize.populateApplicationSettings):
+ (WebInspector.Settings.initialize.populateSessionSettings):
+ (WebInspector.Settings.initialize):
+ * inspector/front-end/inspector.js:
+ (WebInspector.doLoadedDone):
+
2010-08-25 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index cd268ae..7ceea3e 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -287,7 +287,7 @@ PassRefPtr<DocumentParser> HTMLDocument::createParser()
bool reportErrors = false;
#if ENABLE(INSPECTOR)
if (Page* page = this->page())
- reportErrors = page->inspectorController()->windowVisible();
+ reportErrors = page->inspectorController()->hasFrontend();
#endif
return HTMLDocumentParser::create(this, reportErrors);
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index c40e3d7..a56ef14 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -47,9 +47,6 @@ module core {
[notify] void inspectedURLChanged(out String url);
[notify] void monitoringXHRWasEnabled();
[notify] void monitoringXHRWasDisabled();
- [notify] void populateApplicationSettings(out String settings);
- [notify] void populateInterface();
- [notify] void populateSessionSettings(out String settings);
[notify] void removeResource(out unsigned long identifier);
[notify] void reset();
[notify] void resetProfilesPanel();
@@ -102,6 +99,10 @@ module core {
[notify] void didDestroyWorker(out long id);
#endif
+ // This method is going to be broken down into smaller parts.
+ [handler=Controller] void populateScriptObjects();
+
+ [handler=Controller] void getSettings(in long callId, out Object settings);
[handler=Controller] void storeLastActivePanel(in String panelName);
[handler=Controller] void saveApplicationSettings(in String settings);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 9002d53..f47b321 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -247,6 +247,13 @@ void InspectorController::saveSessionSettings(const String& settingsJSON)
m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
}
+void InspectorController::getSettings(RefPtr<InspectorObject>* settings)
+{
+ *settings = InspectorObject::create();
+ (*settings)->setString("application", setting(frontendSettingsSettingName()));
+ (*settings)->setString("session", m_sessionSettings->toJSONString());
+}
+
void InspectorController::inspect(Node* node)
{
if (!enabled())
@@ -303,11 +310,6 @@ void InspectorController::hideHighlight()
m_client->hideHighlight();
}
-bool InspectorController::windowVisible()
-{
- return m_frontend;
-}
-
void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack, const String& message)
{
if (!enabled())
@@ -488,8 +490,6 @@ void InspectorController::connectFrontend()
// Initialize Web Inspector title.
m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string());
- populateScriptObjects();
-
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled()) {
// FIXME (40364): This will force pushing script sources to frontend even if script
@@ -508,13 +508,6 @@ void InspectorController::connectFrontend()
}
#endif
- if (m_showAfterVisible == lastActivePanel)
- m_showAfterVisible = setting(lastActivePanel);
-
- if (m_nodeToFocus)
- focusNode();
- showPanel(m_showAfterVisible);
-
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_frontend.get());
#endif
@@ -625,7 +618,11 @@ void InspectorController::populateScriptObjects()
if (!m_frontend)
return;
- m_frontend->populateApplicationSettings(setting(frontendSettingsSettingName()));
+ if (m_showAfterVisible == lastActivePanel)
+ m_showAfterVisible = setting(lastActivePanel);
+ if (m_nodeToFocus)
+ focusNode();
+ showPanel(m_showAfterVisible);
if (m_resourceTrackingEnabled)
m_frontend->resourceTrackingWasEnabled();
@@ -675,9 +672,6 @@ void InspectorController::populateScriptObjects()
}
#endif
- m_frontend->populateSessionSettings(m_sessionSettings->toJSONString());
- m_frontend->populateInterface();
-
// Dispatch pending frontend commands
for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); it != m_pendingEvaluateTestCommands.end(); ++it)
m_frontend->evaluateForTestInFrontend((*it).first, (*it).second);
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 7cd189b..7ed2549 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -118,7 +118,7 @@ public:
void setSetting(const String& key, const String& value);
void saveApplicationSettings(const String& settings);
void saveSessionSettings(const String&);
-
+ void getSettings(RefPtr<InspectorObject>*);
void inspect(Node*);
void highlight(Node*);
@@ -150,8 +150,6 @@ public:
void inspectedWindowScriptObjectCleared(Frame*);
- bool windowVisible();
-
void didCommitLoad(DocumentLoader*);
void frameDetachedFromParent(Frame*);
void didLoadResourceFromMemoryCache(DocumentLoader*, const CachedResource*);
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index e5877d9..e18274c 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -158,26 +158,20 @@ WebInspector.ProfilesPanel.prototype = {
show: function()
{
WebInspector.Panel.prototype.show.call(this);
- if (this._shouldPopulateProfiles)
+ if (!this._profilesWereRequested)
this._populateProfiles();
},
- populateInterface: function()
- {
- this._reset();
- if (this.visible)
- this._populateProfiles();
- else
- this._shouldPopulateProfiles = true;
- },
-
profilerWasEnabled: function()
{
if (this._profilerEnabled)
return;
this._profilerEnabled = true;
- this.populateInterface();
+
+ this._reset();
+ if (this.visible)
+ this._populateProfiles();
},
profilerWasDisabled: function()
@@ -207,6 +201,7 @@ WebInspector.ProfilesPanel.prototype = {
this._profilesIdMap = {};
this._profileGroups = {};
this._profileGroupsForLinks = {}
+ this._profilesWereRequested = false;
this.sidebarTreeElement.removeStyleClass("some-expandable");
@@ -532,7 +527,7 @@ WebInspector.ProfilesPanel.prototype = {
var callId = WebInspector.Callback.wrap(populateCallback);
InspectorBackend.getProfileHeaders(callId);
- delete this._shouldPopulateProfiles;
+ this._profilesWereRequested = true;
},
updateMainViewWidth: function(width)
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 68e40c4..33a1b91 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -47,33 +47,44 @@ var Preferences = {
domBreakpointsEnabled: false
}
-WebInspector.populateApplicationSettings = function(settingsString)
+WebInspector.Settings = function(sessionScope)
{
- WebInspector.applicationSettings._load(settingsString);
- WebInspector.applicationSettings.installSetting("eventListenersFilter", "event-listeners-filter", "all");
- WebInspector.applicationSettings.installSetting("colorFormat", "color-format", "hex");
- WebInspector.applicationSettings.installSetting("resourcesLargeRows", "resources-large-rows", true);
- WebInspector.applicationSettings.installSetting("watchExpressions", "watch-expressions", []);
- WebInspector.applicationSettings.installSetting("lastViewedScriptFile", "last-viewed-script-file");
- WebInspector.applicationSettings.installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false);
- WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true);
- WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content");
- WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []);
- WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"});
-
- WebInspector.applicationSettings.dispatchEventToListeners("loaded");
+ this._sessionScope = sessionScope;
+ this._store = {};
}
-WebInspector.populateSessionSettings = function(settingsString)
+WebInspector.Settings.initialize = function()
{
- WebInspector.sessionSettings._load(settingsString);
- WebInspector.sessionSettings.dispatchEventToListeners("loaded");
-}
+ WebInspector.applicationSettings = new WebInspector.Settings(false);
+ WebInspector.sessionSettings = new WebInspector.Settings(true);
-WebInspector.Settings = function(sessionScope)
-{
- this._sessionScope = sessionScope;
- this._store = {};
+ function populateApplicationSettings(settingsString)
+ {
+ WebInspector.applicationSettings._load(settingsString);
+ WebInspector.applicationSettings.installSetting("eventListenersFilter", "event-listeners-filter", "all");
+ WebInspector.applicationSettings.installSetting("colorFormat", "color-format", "hex");
+ WebInspector.applicationSettings.installSetting("resourcesLargeRows", "resources-large-rows", true);
+ WebInspector.applicationSettings.installSetting("watchExpressions", "watch-expressions", []);
+ WebInspector.applicationSettings.installSetting("lastViewedScriptFile", "last-viewed-script-file");
+ WebInspector.applicationSettings.installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false);
+ WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true);
+ WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content");
+ WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []);
+ WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"});
+
+ WebInspector.applicationSettings.dispatchEventToListeners("loaded");
+ }
+
+ function populateSessionSettings(settingsString)
+ {
+ WebInspector.sessionSettings._load(settingsString);
+ WebInspector.sessionSettings.dispatchEventToListeners("loaded");
+ }
+
+ InspectorBackend.getSettings(WebInspector.Callback.wrap(function(settings) {
+ populateApplicationSettings(settings.application);
+ populateSessionSettings(settings.session);
+ }));
}
WebInspector.Settings.prototype = {
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 991bffe..db89e20 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -491,8 +491,9 @@ WebInspector.doLoadedDone = function()
var port = WebInspector.port;
document.body.addStyleClass("port-" + port);
- this.applicationSettings = new WebInspector.Settings(false);
- this.sessionSettings = new WebInspector.Settings(true);
+ InspectorFrontendHost.loaded();
+ WebInspector.Settings.initialize();
+
this._registerShortcuts();
// set order of some sections explicitly
@@ -579,7 +580,7 @@ WebInspector.doLoadedDone = function()
this.extensionServer.initExtensions();
- InspectorFrontendHost.loaded();
+ InspectorBackend.populateScriptObjects();
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
InspectorBackend.getSupportedCSSProperties(WebInspector.Callback.wrap(WebInspector.CSSCompletions._load));
@@ -1450,15 +1451,6 @@ WebInspector.resumedScript = function()
this.panels.scripts.debuggerResumed();
}
-WebInspector.populateInterface = function()
-{
- for (var panelName in this.panels) {
- var panel = this.panels[panelName];
- if ("populateInterface" in panel)
- panel.populateInterface();
- }
-}
-
WebInspector.reset = function()
{
for (var panelName in this.panels) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list