Skip to content
Permalink
Browse files
2010-03-04 Pavel Feldman <pfeldman@chromium.org>
        Reviewed by Timothy Hatcher.

        Web Inspector: Remove sync access to resourceTrackingEnabled.

        https://bugs.webkit.org/show_bug.cgi?id=35693

        * inspector/InspectorBackend.cpp:
        * inspector/InspectorBackend.h:
        * inspector/InspectorBackend.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::populateScriptObjects):
        * inspector/front-end/AuditsPanel.js:
        (WebInspector.AuditsPanel.prototype._reloadResources):
        (WebInspector.AuditsPanel.prototype.show):
        * inspector/front-end/InspectorBackendStub.js:
        (.WebInspector.InspectorBackendStub):
        (.WebInspector.InspectorBackendStub.prototype.enableResourceTracking):
        (.WebInspector.InspectorBackendStub.prototype.disableResourceTracking):
        (.WebInspector.InspectorBackendStub.prototype.enableDebugger):
        (.WebInspector.InspectorBackendStub.prototype.disableDebugger):
        (.WebInspector.InspectorBackendStub.prototype.enableProfiler):
        (.WebInspector.InspectorBackendStub.prototype.disableProfiler):
        * inspector/front-end/ResourcesPanel.js:
        (WebInspector.ResourcesPanel):
        (WebInspector.ResourcesPanel.prototype.get resourceTrackingEnabled):
        (WebInspector.ResourcesPanel.prototype.get visibleView):
        (WebInspector.ResourcesPanel.prototype.resourceTrackingWasEnabled):
        (WebInspector.ResourcesPanel.prototype.resourceTrackingWasDisabled):
        (WebInspector.ResourcesPanel.prototype.reset):
        (WebInspector.ResourcesPanel.prototype.showResource):
        (WebInspector.ResourcesPanel.prototype._enableResourceTracking):
        (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):


Canonical link: https://commits.webkit.org/46832@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pavelfeldman committed Mar 4, 2010
1 parent 7283873 commit 0866552a94c74e1d5bcf0fff66189b1720694d79
Showing 12 changed files with 71 additions and 78 deletions.
@@ -1,3 +1,38 @@
2010-03-04 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Remove sync access to resourceTrackingEnabled.

https://bugs.webkit.org/show_bug.cgi?id=35693

* inspector/InspectorBackend.cpp:
* inspector/InspectorBackend.h:
* inspector/InspectorBackend.idl:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::populateScriptObjects):
* inspector/front-end/AuditsPanel.js:
(WebInspector.AuditsPanel.prototype._reloadResources):
(WebInspector.AuditsPanel.prototype.show):
* inspector/front-end/InspectorBackendStub.js:
(.WebInspector.InspectorBackendStub):
(.WebInspector.InspectorBackendStub.prototype.enableResourceTracking):
(.WebInspector.InspectorBackendStub.prototype.disableResourceTracking):
(.WebInspector.InspectorBackendStub.prototype.enableDebugger):
(.WebInspector.InspectorBackendStub.prototype.disableDebugger):
(.WebInspector.InspectorBackendStub.prototype.enableProfiler):
(.WebInspector.InspectorBackendStub.prototype.disableProfiler):
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel):
(WebInspector.ResourcesPanel.prototype.get resourceTrackingEnabled):
(WebInspector.ResourcesPanel.prototype.get visibleView):
(WebInspector.ResourcesPanel.prototype.resourceTrackingWasEnabled):
(WebInspector.ResourcesPanel.prototype.resourceTrackingWasDisabled):
(WebInspector.ResourcesPanel.prototype.reset):
(WebInspector.ResourcesPanel.prototype.showResource):
(WebInspector.ResourcesPanel.prototype._enableResourceTracking):
(WebInspector.ResourcesPanel.prototype._toggleResourceTracking):

2010-03-04 Antoine Quint <ml@graougraou.com>

Reviewed by Darin Adler.
@@ -104,13 +104,6 @@ bool InspectorBackend::searchingForNode()
return false;
}

bool InspectorBackend::resourceTrackingEnabled() const
{
if (m_inspectorController)
return m_inspectorController->resourceTrackingEnabled();
return false;
}

void InspectorBackend::enableResourceTracking(bool always)
{
if (m_inspectorController)
@@ -66,7 +66,6 @@ class InspectorBackend : public RefCounted<InspectorBackend>

void enableResourceTracking(bool always);
void disableResourceTracking(bool always);
bool resourceTrackingEnabled() const;
void getResourceContent(long callId, unsigned long identifier);
void reloadPage();

@@ -39,7 +39,6 @@ module core {
void toggleNodeSearch();
boolean searchingForNode();

boolean resourceTrackingEnabled();
void enableResourceTracking(in boolean always);
void disableResourceTracking(in boolean always);
void getResourceContent(in long callId, in unsigned long identifier);
@@ -668,6 +668,13 @@ void InspectorController::populateScriptObjects()

m_frontend->populateFrontendSettings(setting(FrontendSettingsSettingName));

if (m_resourceTrackingEnabled)
m_frontend->resourceTrackingWasEnabled();
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerEnabled)
m_frontend->profilerWasEnabled();
#endif

ResourcesMap::iterator resourcesEnd = m_resources.end();
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->updateScriptObject(m_frontend.get());
@@ -695,10 +702,6 @@ void InspectorController::populateScriptObjects()
for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it)
m_frontend->didCreateWorker(*it->second);
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerEnabled)
m_frontend->profilerWasEnabled();
#endif

m_frontend->populateInterface();

@@ -188,7 +188,7 @@ WebInspector.AuditsPanel.prototype = {
{
this._resourceTrackingCallback = callback;

if (!InspectorBackend.resourceTrackingEnabled()) {
if (!WebInspector.panels.resources.resourceTrackingEnabled) {
InspectorBackend.enableResourceTracking(false);
this._updateLauncherViewControls(true);
} else
@@ -238,7 +238,7 @@ WebInspector.AuditsPanel.prototype = {
WebInspector.Panel.prototype.show.call(this);

this.showView();
this._updateLauncherViewControls(InspectorBackend.resourceTrackingEnabled());
this._updateLauncherViewControls(WebInspector.panels.resources.resourceTrackingEnabled);
},

attach: function()
@@ -34,9 +34,6 @@ WebInspector.InspectorBackendStub = function()
{
this._searchingForNode = false;
this._attachedWindowHeight = 0;
this._debuggerEnabled = true;
this._profilerEnabled = true;
this._resourceTrackingEnabled = false;
this._timelineEnabled = false;
}

@@ -126,40 +123,28 @@ WebInspector.InspectorBackendStub.prototype = {
return "";
},

debuggerEnabled: function()
{
return this._debuggerEnabled;
},

enableResourceTracking: function()
{
this._resourceTrackingEnabled = true;
WebInspector.resourceTrackingWasEnabled();
},

disableResourceTracking: function()
{
this._resourceTrackingEnabled = false;
WebInspector.resourceTrackingWasDisabled();
},

resourceTrackingEnabled: function()
{
return this._resourceTrackingEnabled;
},

reloadPage: function()
{
},

enableDebugger: function()
{
this._debuggerEnabled = true;
WebInspector.debuggerWasEnabled();
},

disableDebugger: function()
{
this._debuggerEnabled = false;
WebInspector.debuggerWasDisabled();
},

setBreakpoint: function(sourceID, line, enabled, condition)
@@ -197,19 +182,14 @@ WebInspector.InspectorBackendStub.prototype = {
{
},

profilerEnabled: function()
{
return true;
},

enableProfiler: function()
{
this._profilerEnabled = true;
WebInspector.profilerWasEnabled();
},

disableProfiler: function()
{
this._profilerEnabled = false;
WebInspector.profilerWasDisabled();
},

startProfiling: function()
@@ -47,6 +47,7 @@ WebInspector.ResourcesPanel = function()
this.reset();
this.filter(this.filterAllElement, false);
this.graphsTreeElement.children[0].select();
this._resourceTrackingEnabled = false;
}

WebInspector.ResourcesPanel.prototype = {
@@ -126,6 +127,11 @@ WebInspector.ResourcesPanel.prototype = {
this.itemsTreeElement.expand();
},

get resourceTrackingEnabled()
{
return this._resourceTrackingEnabled;
},

_createPanelEnabler: function()
{
var panelEnablerHeading = WebInspector.UIString("You need to enable resource tracking to use this panel.");
@@ -282,7 +288,7 @@ WebInspector.ResourcesPanel.prototype = {
{
if (this.visibleResource)
return this.visibleResource._resourcesView;
return InspectorBackend.resourceTrackingEnabled() ? null : this.panelEnablerView;
return this._resourceTrackingEnabled ? null : this.panelEnablerView;
},

get sortingFunction()
@@ -311,11 +317,13 @@ WebInspector.ResourcesPanel.prototype = {

resourceTrackingWasEnabled: function()
{
this._resourceTrackingEnabled = true;
this.reset();
},

resourceTrackingWasDisabled: function()
{
this._resourceTrackingEnabled = false;
this.reset();
},

@@ -347,7 +355,7 @@ WebInspector.ResourcesPanel.prototype = {

this.summaryBar.reset();

if (InspectorBackend.resourceTrackingEnabled()) {
if (this._resourceTrackingEnabled) {
this.enableToggleButton.title = WebInspector.UIString("Resource tracking enabled. Click to disable.");
this.enableToggleButton.toggled = true;
this.largerResourcesButton.visible = true;
@@ -690,14 +698,14 @@ WebInspector.ResourcesPanel.prototype = {

_enableResourceTracking: function()
{
if (InspectorBackend.resourceTrackingEnabled())
if (this._resourceTrackingEnabled)
return;
this._toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
},

_toggleResourceTracking: function(optionalAlways)
{
if (InspectorBackend.resourceTrackingEnabled()) {
if (this._resourceTrackingEnabled) {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
WebInspector.resources = {};
@@ -1,3 +1,13 @@
2010-03-03 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Remove sync access to resourceTrackingEnabled.

https://bugs.webkit.org/show_bug.cgi?id=35693

* src/js/DevTools.js:

2010-03-04 Darin Fisher <darin@chromium.org>

Reviewed by Pavel Feldman.
@@ -161,15 +161,6 @@ void WebDevToolsAgentImpl::disposeUtilityContext()
}
}

void WebDevToolsAgentImpl::unhideResourcesPanelIfNecessary()
{
InspectorController* ic = m_webViewImpl->page()->inspectorController();
ic->ensureResourceTrackingSettingsLoaded();
String command = String::format("[\"setResourcesPanelEnabled\", %s]",
ic->resourceTrackingEnabled() ? "true" : "false");
m_toolsAgentDelegateStub->dispatchOnClient(command);
}

void WebDevToolsAgentImpl::attach()
{
if (m_attached)
@@ -179,7 +170,7 @@ void WebDevToolsAgentImpl::attach()
m_debuggerAgentDelegateStub.get(),
this));
resetInspectorFrontendProxy();
unhideResourcesPanelIfNecessary();

// Allow controller to send messages to the frontend.
InspectorController* ic = inspectorController();

@@ -228,7 +219,6 @@ void WebDevToolsAgentImpl::didCommitProvisionalLoad(WebFrameImpl* webframe, bool
resetInspectorFrontendProxy();
m_toolsAgentDelegateStub->frameNavigate(WebCore::KURL(url).string());
SetApuAgentEnabledInUtilityContext(m_utilityContext, m_apuAgentEnabled);
unhideResourcesPanelIfNecessary();
}
}

@@ -106,7 +106,6 @@ class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate,
static v8::Handle<v8::Value> jsOnRuntimeFeatureStateChanged(const v8::Arguments& args);

void disposeUtilityContext();
void unhideResourcesPanelIfNecessary();

void compileUtilityScripts();
void initDevToolsAgentHost();
@@ -150,17 +150,6 @@ devtools.ToolsAgent.prototype.evaluate = function(expr)
};


/**
* Enables / disables resources panel in the ui.
* @param {boolean} enabled New panel status.
*/
WebInspector.setResourcesPanelEnabled = function(enabled)
{
InspectorBackend._resourceTrackingEnabled = enabled;
WebInspector.panels.resources.reset();
};


/**
* Prints string to the inspector console or shows alert if the console doesn't
* exist.
@@ -377,18 +366,6 @@ InjectedScriptAccess.prototype.evaluateInCallFrame = function(callFrameId, code,
})();


WebInspector.resourceTrackingWasEnabled = function()
{
InspectorBackend._resourceTrackingEnabled = true;
this.panels.resources.resourceTrackingWasEnabled();
};

WebInspector.resourceTrackingWasDisabled = function()
{
InspectorBackend._resourceTrackingEnabled = false;
this.panels.resources.resourceTrackingWasDisabled();
};

(function()
{
var orig = WebInspector.ConsoleMessage.prototype.setMessageBody;

0 comments on commit 0866552

Please sign in to comment.