2010-12-17 Andrey Kosyakov <caseq@chromium.org>
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2010 13:52:53 +0000 (13:52 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2010 13:52:53 +0000 (13:52 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: clear extra/override headers when front-end is closed
        https://bugs.webkit.org/show_bug.cgi?id=51244

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::disconnectFrontend):
        (WebCore::InspectorController::willSendRequest):

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

WebCore/ChangeLog
WebCore/inspector/InspectorController.cpp

index 6c93127..a47552d 100644 (file)
@@ -1,3 +1,14 @@
+2010-12-17  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: clear extra/override headers when front-end is closed
+        https://bugs.webkit.org/show_bug.cgi?id=51244
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::willSendRequest):
+
 2010-12-17  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 173a73b..46d1020 100644 (file)
@@ -576,6 +576,7 @@ void InspectorController::disconnectFrontend()
 
     releaseFrontendLifetimeAgents();
     m_timelineAgent.clear();
+    m_extraHeaders.clear();
 }
 
 void InspectorController::releaseFrontendLifetimeAgents()
@@ -825,19 +826,20 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
         return;
 
     request.setReportLoadTiming(true);
-    // Only enable raw headers if front-end is attached, as otherwise we may lack
-    // permissions to fetch the headers.
-    if (m_frontend)
+
+    if (m_frontend) {
+        // Only enable raw headers if front-end is attached, as otherwise we may lack
+        // permissions to fetch the headers.
         request.setReportRawHeaders(true);
 
-    if (m_extraHeaders) {
-        HTTPHeaderMap::const_iterator end = m_extraHeaders->end();
-        for (HTTPHeaderMap::const_iterator it = m_extraHeaders->begin(); it != end; ++it)
-            request.setHTTPHeaderField(it->first, it->second);
+        if (m_extraHeaders) {
+            HTTPHeaderMap::const_iterator end = m_extraHeaders->end();
+            for (HTTPHeaderMap::const_iterator it = m_extraHeaders->begin(); it != end; ++it)
+                request.setHTTPHeaderField(it->first, it->second);
+        }
     }
 
     bool isMainResource = m_mainResourceIdentifier == identifier;
-
     if (m_timelineAgent)
         m_timelineAgent->willSendResourceRequest(identifier, isMainResource, request);