Changeset 51182 in webkit


Ignore:
Timestamp:
Nov 19, 2009 5:03:10 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-19 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Store cookie domains in the WebInspector object

The cookie domains have been moved from StoragePanel into WebInspector.
Also, the document URLs are now passed inside the WebInspector.addResource()
payload rather than pushed directly from InspectorController.
https://bugs.webkit.org/show_bug.cgi?id=31627

  • inspector/InspectorController.cpp: (WebCore::InspectorController::populateScriptObjects): (WebCore::InspectorController::didFinishLoading):
  • inspector/InspectorFrontend.cpp:
  • inspector/InspectorFrontend.h:
  • inspector/InspectorResource.cpp: (WebCore::InspectorResource::createScriptObject): (WebCore::InspectorResource::updateScriptObject):
  • inspector/front-end/StoragePanel.js: (WebInspector.StoragePanel.prototype.reset): (WebInspector.StoragePanel.prototype.addCookieDomain):
  • inspector/front-end/inspector.js: (WebInspector.addResource): (WebInspector.addCookieDomain): (WebInspector.reset):
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51179 r51182  
     12009-11-19  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Store cookie domains in the WebInspector object
     6
     7        The cookie domains have been moved from StoragePanel into WebInspector.
     8        Also, the document URLs are now passed inside the WebInspector.addResource()
     9        payload rather than pushed directly from InspectorController.
     10        https://bugs.webkit.org/show_bug.cgi?id=31627
     11
     12        * inspector/InspectorController.cpp:
     13        (WebCore::InspectorController::populateScriptObjects):
     14        (WebCore::InspectorController::didFinishLoading):
     15        * inspector/InspectorFrontend.cpp:
     16        * inspector/InspectorFrontend.h:
     17        * inspector/InspectorResource.cpp:
     18        (WebCore::InspectorResource::createScriptObject):
     19        (WebCore::InspectorResource::updateScriptObject):
     20        * inspector/front-end/StoragePanel.js:
     21        (WebInspector.StoragePanel.prototype.reset):
     22        (WebInspector.StoragePanel.prototype.addCookieDomain):
     23        * inspector/front-end/inspector.js:
     24        (WebInspector.addResource):
     25        (WebInspector.addCookieDomain):
     26        (WebInspector.reset):
     27
    1282009-11-19  Zoltan Horvath  <zoltan@webkit.org>
    229
  • trunk/WebCore/inspector/InspectorController.cpp

    r51117 r51182  
    671671
    672672    ResourcesMap::iterator resourcesEnd = m_resources.end();
    673     for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
     673    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
    674674        it->second->createScriptObject(m_frontend.get());
    675         KURL resourceURL = it->second->frame()->document()->url();
    676         if (resourceURL.protocolInHTTPFamily() || resourceURL.protocolIs("file"))
    677             m_frontend->addCookieDomain(resourceURL.host());
    678     }
    679675
    680676    unsigned messageCount = m_consoleMessages.size();
     
    10121008    addResource(resource.get());
    10131009
    1014     if (windowVisible()) {
     1010    if (windowVisible())
    10151011        resource->updateScriptObject(m_frontend.get());
    1016         KURL resourceURL = resource->frame()->document()->url();
    1017         if (resourceURL.protocolInHTTPFamily() || resourceURL.protocolIs("file"))
    1018             m_frontend->addCookieDomain(resourceURL.host());
    1019     }
    10201012}
    10211013
  • trunk/WebCore/inspector/InspectorFrontend.cpp

    r50337 r51182  
    133133}
    134134
    135 void InspectorFrontend::addCookieDomain(String domain)
    136 {
    137     OwnPtr<ScriptFunctionCall> function(newFunctionCall("addCookieDomain"));
    138     function->appendArgument(domain);
    139     function->call();
    140 }
    141 
    142135void InspectorFrontend::updateFocusedNode(long long nodeId)
    143136{
  • trunk/WebCore/inspector/InspectorFrontend.h

    r50125 r51182  
    7171        bool updateResource(long long identifier, const ScriptObject& resourceObj);
    7272        void removeResource(long long identifier);
    73 
    74         void addCookieDomain(String);
    7573
    7674        void updateFocusedNode(long long nodeId);
  • trunk/WebCore/inspector/InspectorResource.cpp

    r50905 r51182  
    129129        populateHeadersObject(&requestHeaders, m_requestHeaderFields);
    130130        jsonObject.set("requestHeaders", requestHeaders);
     131        jsonObject.set("documentURL", m_frame->document()->url().string());
    131132        jsonObject.set("requestURL", requestURL());
    132133        jsonObject.set("host", m_requestURL.host());
     
    157158    if (m_changes.hasChange(RequestChange)) {
    158159        jsonObject.set("url", requestURL());
     160        jsonObject.set("documentURL", m_frame->document()->url().string());
    159161        jsonObject.set("domain", m_requestURL.host());
    160162        jsonObject.set("path", m_requestURL.path());
  • trunk/WebCore/inspector/front-end/StoragePanel.js

    r50033 r51182  
    9898        this._domStorage = [];
    9999
    100         this._cookieDomains = {};
    101100        this._cookieViews = {};
    102101
     
    125124    addCookieDomain: function(domain)
    126125    {
    127         // Eliminate duplicate domains from the list.
    128         if (typeof this._cookieDomains[domain] !== "undefined")
    129             return;
    130 
    131126        var cookieDomainTreeElement = new WebInspector.CookieSidebarTreeElement(domain);
    132127        this.cookieListTreeElement.appendChild(cookieDomainTreeElement);
    133         this._cookieDomains[domain] = true;
    134128    },
    135129
  • trunk/WebCore/inspector/front-end/inspector.js

    r51134 r51182  
    7171    resources: {},
    7272    resourceURLMap: {},
     73    cookieDomains: {},
    7374    missingLocalizedStrings: {},
    7475
     
    985986    if (this.panels.resources)
    986987        this.panels.resources.addResource(resource);
     988
     989    var match = payload.documentURL.match(/^(http[s]?|file):\/\/([\/]*[^\/]+)/i);
     990    if (match)
     991        this.addCookieDomain(match[1].toLowerCase() === "file" ? "" : match[2]);
    987992}
    988993
     
    10961101WebInspector.addCookieDomain = function(domain)
    10971102{
     1103    // Eliminate duplicate domains from the list.
     1104    if (domain in this.cookieDomains)
     1105        return;
     1106    this.cookieDomains[domain] = true;
     1107
    10981108    if (!this.panels.storage)
    10991109        return;
     
    11961206    this.resources = {};
    11971207    this.resourceURLMap = {};
     1208    this.cookieDomains = {};
    11981209    this.hoveredDOMNode = null;
    11991210
Note: See TracChangeset for help on using the changeset viewer.