diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 19:11:40 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 19:11:40 +0000 |
commit | b773b2484a43f38d278630d8776a0672a2336854 (patch) | |
tree | 259f7262923d393a949b2d26d0b34ec1858aa148 /webkit | |
parent | ae1b7001ba325247f5cd82bb6075e4e50c936841 (diff) | |
download | chromium_src-b773b2484a43f38d278630d8776a0672a2336854.zip chromium_src-b773b2484a43f38d278630d8776a0672a2336854.tar.gz chromium_src-b773b2484a43f38d278630d8776a0672a2336854.tar.bz2 |
DevTools: do work with new InspectorController.
Review URL: http://codereview.chromium.org/115518
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 2 | ||||
-rw-r--r-- | webkit/glue/devtools/js/net_agent.js | 31 | ||||
-rw-r--r-- | webkit/glue/devtools/net_agent_impl.cc | 7 | ||||
-rw-r--r-- | webkit/webkit.gyp | 4 |
4 files changed, 17 insertions, 27 deletions
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index d7c0072..f85ad13 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -491,7 +491,7 @@ WebInspector.SourceView.prototype.setupSourceFrameIfNeeded = function() { var netAgent = devtools.tools.getNetAgent(); netAgent.getResourceContentAsync(identifier, function(source) { - var resource = netAgent.getResource(identifier); + var resource = WebInspector.resources[identifier]; if (InspectorController.addSourceToFrame(resource.mimeType, source, element)) { delete self._frameNeedsSetup; diff --git a/webkit/glue/devtools/js/net_agent.js b/webkit/glue/devtools/js/net_agent.js index 64ef4a6..bf4cd68 100644 --- a/webkit/glue/devtools/js/net_agent.js +++ b/webkit/glue/devtools/js/net_agent.js @@ -10,7 +10,6 @@ goog.provide('devtools.NetAgent'); devtools.NetAgent = function() { - this.resources_ = {}; this.id_for_url_ = {}; RemoteNetAgent.GetResourceContentResult = @@ -28,22 +27,11 @@ devtools.NetAgent = function() { * Resets dom agent to its initial state. */ devtools.NetAgent.prototype.reset = function() { - this.resources_ = {}; this.id_for_url_ = {}; }; /** - * Returns resource object for given identifier. - * @param {number} identifier Identifier to get resource for. - * @return {WebInspector.Resouce} Resulting resource. - */ -devtools.NetAgent.prototype.getResource = function(identifier) { - return this.resources_[identifier]; -}; - - -/** * Asynchronously queries for the resource content. * @param {number} identifier Resource identifier. * @param {function(string):undefined} opt_callback Callback to call when @@ -51,7 +39,7 @@ devtools.NetAgent.prototype.getResource = function(identifier) { */ devtools.NetAgent.prototype.getResourceContentAsync = function(identifier, opt_callback) { - var resource = this.resources_[identifier]; + var resource = WebInspector.resources[identifier]; if (!resource) { return; } @@ -71,20 +59,15 @@ devtools.NetAgent.prototype.getResourceContentAsync = function(identifier, */ devtools.NetAgent.prototype.willSendRequest = function(identifier, request) { // Resource object is already created. - var resource = this.resources_[identifier]; + var resource = WebInspector.resources[identifier]; if (resource) { return; } - var mainResource = false; - var cached = false; - var resource = new WebInspector.Resource(request.requestHeaders, - request.url, request.domain, request.path, request.lastPathComponent, - identifier, mainResource, cached); + WebInspector.addResource(identifier, request); + var resource = WebInspector.resources[identifier]; resource.startTime = request.startTime; - WebInspector.addResource(resource); - this.resources_[identifier] = resource; - this.id_for_url_[request.url] = identifier; + this.id_for_url_[resource.url] = identifier; }; @@ -93,7 +76,7 @@ devtools.NetAgent.prototype.willSendRequest = function(identifier, request) { * {@inheritDoc}. */ devtools.NetAgent.prototype.didReceiveResponse = function(identifier, response) { - var resource = this.resources_[identifier]; + var resource = WebInspector.resources[identifier]; if (!resource) { return; } @@ -130,7 +113,7 @@ devtools.NetAgent.prototype.didFinishLoading = function(identifier, value) { this.willSendRequest(identifier, value); this.didReceiveResponse(identifier, value); - var resource = this.resources_[identifier]; + var resource = WebInspector.resources[identifier]; if (!resource) { return; } diff --git a/webkit/glue/devtools/net_agent_impl.cc b/webkit/glue/devtools/net_agent_impl.cc index d1c45e6..ab3d60b 100644 --- a/webkit/glue/devtools/net_agent_impl.cc +++ b/webkit/glue/devtools/net_agent_impl.cc @@ -279,9 +279,9 @@ void NetAgentImpl::Serialize(const Resource& resource, value->SetReal(L"responseReceivedTime", resource.response_received_time); value->SetReal(L"endTime", resource.end_time); - value->SetString(L"url", + value->SetString(L"requestURL", webkit_glue::StringToStdString(resource.url.string())); - value->SetString(L"domain", + value->SetString(L"host", webkit_glue::StringToStdString(resource.url.host())); value->SetString(L"path", webkit_glue::StringToStdString(resource.url.path())); @@ -303,6 +303,9 @@ void NetAgentImpl::Serialize(const Resource& resource, value->Set(L"responseHeaders", BuildValueForHeaders(resource.response_headers)); + value->SetBoolean(L"isMainResource", false); + value->SetBoolean(L"cached", false); + if (resource.error_code) { value->SetInteger(L"errorCode", resource.error_code); value->SetString(L"localizedDescription", diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 4941cea..45c145f 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -1819,6 +1819,8 @@ '../third_party/WebKit/WebCore/inspector/InspectorDatabaseResource.h', '../third_party/WebKit/WebCore/inspector/InspectorDOMStorageResource.cpp', '../third_party/WebKit/WebCore/inspector/InspectorDOMStorageResource.h', + '../third_party/WebKit/WebCore/inspector/InspectorFrontend.cpp', + '../third_party/WebKit/WebCore/inspector/InspectorFrontend.h', '../third_party/WebKit/WebCore/inspector/InspectorResource.cpp', '../third_party/WebKit/WebCore/inspector/InspectorResource.h', '../third_party/WebKit/WebCore/inspector/JavaScriptCallFrame.cpp', @@ -1830,6 +1832,8 @@ '../third_party/WebKit/WebCore/inspector/JavaScriptProfile.h', '../third_party/WebKit/WebCore/inspector/JavaScriptProfileNode.cpp', '../third_party/WebKit/WebCore/inspector/JavaScriptProfileNode.h', + '../third_party/WebKit/WebCore/inspector/JSONObject.cpp', + '../third_party/WebKit/WebCore/inspector/JSONObject.h', '../third_party/WebKit/WebCore/loader/appcache/ApplicationCache.cpp', '../third_party/WebKit/WebCore/loader/appcache/ApplicationCache.h', '../third_party/WebKit/WebCore/loader/appcache/ApplicationCacheGroup.cpp', |