Web Inspector: remove stackTrace property from requestWillBeSent - it is already...
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 15:14:27 +0000 (15:14 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 15:14:27 +0000 (15:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84964

Reviewed by Yury Semikhatsky.

* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willSendRequest):
* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype._formatMessage):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
(WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
(WebInspector.NetworkDispatcher.prototype._appendRedirect):
(WebInspector.NetworkDispatcher.prototype._createNetworkRequest):
(get WebInspector):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/inspector/front-end/ConsoleMessage.js
Source/WebCore/inspector/front-end/NetworkManager.js

index 067ec88..ed1f1db 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: remove stackTrace property from requestWillBeSent - it is already a part of the initiator.
+        https://bugs.webkit.org/show_bug.cgi?id=84964
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::willSendRequest):
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl.prototype._formatMessage):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
+        (WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
+        (WebInspector.NetworkDispatcher.prototype._appendRedirect):
+        (WebInspector.NetworkDispatcher.prototype._createNetworkRequest):
+        (get WebInspector):
+
 2012-04-26  Stephen Chenney  <schenney@chromium.org>
 
         SVG FEConvolveMatrix does not check for invalid property values
index 9dc9bf0..140fd61 100644 (file)
                     { "name": "request", "$ref": "Request", "description": "Request data." },
                     { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
                     { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },
-                    { "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "JavaScript stack trace upon issuing this request." },
                     { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." }
                 ]
             },
index 891d21e..9162e6e 100644 (file)
@@ -224,14 +224,8 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
         request.setHTTPHeaderField("Cache-Control", "no-cache");
     }
 
-    RefPtr<ScriptCallStack> callStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture, true);
-    RefPtr<TypeBuilder::Array<TypeBuilder::Console::CallFrame> > callStackValue;
-    if (callStack)
-        callStackValue = callStack->buildInspectorArray();
-    else
-        callStackValue = TypeBuilder::Array<TypeBuilder::Console::CallFrame>::create();
     RefPtr<TypeBuilder::Network::Initiator> initiatorObject = buildInitiatorObject(loader->frame() ? loader->frame()->document() : 0);
-    m_frontend->requestWillBeSent(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), loader->url().string(), buildObjectForResourceRequest(request), currentTime(), initiatorObject, callStackValue, buildObjectForResourceResponse(redirectResponse, loader));
+    m_frontend->requestWillBeSent(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), loader->url().string(), buildObjectForResourceRequest(request), currentTime(), initiatorObject, buildObjectForResourceResponse(redirectResponse, loader));
 }
 
 void InspectorResourceAgent::markResourceAsCached(unsigned long identifier)
index fbdf65e..e01b9db 100644 (file)
@@ -91,7 +91,7 @@ WebInspector.ConsoleMessageImpl.prototype = {
             }
         } else if (this.source === WebInspector.ConsoleMessage.MessageSource.Network) {
             if (this._request) {
-                this._stackTrace = this._request.stackTrace;
+                this._stackTrace = this._request.initiator.stackTrace;
                 if (this._request.initiator && this._request.initiator.url) {
                     this.url = this._request.initiator.url;
                     this.line = this._request.initiator.lineNumber;
index ebe65bb..71959c6 100644 (file)
@@ -266,10 +266,9 @@ WebInspector.NetworkDispatcher.prototype = {
      * @param {NetworkAgent.Request} request
      * @param {NetworkAgent.Timestamp} time
      * @param {NetworkAgent.Initiator} initiator
-     * @param {ConsoleAgent.StackTrace=} stackTrace
      * @param {NetworkAgent.Response=} redirectResponse
      */
-    requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, time, initiator, stackTrace, redirectResponse)
+    requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, time, initiator, redirectResponse)
     {
         var networkRequest = this._inflightRequestsById[requestId];
         if (networkRequest) {
@@ -279,7 +278,7 @@ WebInspector.NetworkDispatcher.prototype = {
             this.responseReceived(requestId, frameId, loaderId, time, "Other", redirectResponse);
             networkRequest = this._appendRedirect(requestId, time, request.url);
         } else
-            networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, request.url, documentURL, initiator, stackTrace);
+            networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, request.url, documentURL, initiator);
         networkRequest.hasNetworkData = true;
         this._updateNetworkRequestWithRequest(networkRequest, request);
         networkRequest.startTime = time;
@@ -395,7 +394,7 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     requestServedFromMemoryCache: function(requestId, frameId, loaderId, documentURL, time, initiator, cachedResource)
     {
-        var networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator, null);
+        var networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator);
         this._updateNetworkRequestWithCachedResource(networkRequest, cachedResource);
         networkRequest.cached = true;
         networkRequest.requestMethod = "GET";
@@ -482,7 +481,7 @@ WebInspector.NetworkDispatcher.prototype = {
             originalNetworkRequest.redirectSource = previousRedirects[previousRedirects.length - 1];
         this._finishNetworkRequest(originalNetworkRequest, time);
         var newNetworkRequest = this._createNetworkRequest(requestId, originalNetworkRequest.frameId, originalNetworkRequest.loaderId,
-             redirectURL, originalNetworkRequest.documentURL, originalNetworkRequest.initiator, originalNetworkRequest.stackTrace);
+             redirectURL, originalNetworkRequest.documentURL, originalNetworkRequest.initiator);
         newNetworkRequest.redirects = previousRedirects.concat(originalNetworkRequest);
         return newNetworkRequest;
     },
@@ -540,7 +539,6 @@ WebInspector.NetworkDispatcher.prototype = {
     {
         var networkRequest = new WebInspector.NetworkRequest(requestId, url, documentURL, frameId, loaderId);
         networkRequest.initiator = initiator;
-        networkRequest.stackTrace = stackTrace;
         return networkRequest;
     }
 }