Changeset 139726 in webkit


Ignore:
Timestamp:
Jan 15, 2013 1:06:01 AM (11 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Support inspector file system access with isolated file system through InspectorFrontendHost.
https://bugs.webkit.org/show_bug.cgi?id=105727

Reviewed by Pavel Feldman.

Source/WebCore:

File system access through isolated file system is implemented in inspector.
File system access requests are sent through InspectorFrontendHost.
Introduced IsolatedFileSystemModel encapsulating file system access logic.
Introduced FileSystemMapping that provides mapping between workspace uris and file system pathes.
DOMFileSystem.createIsolatedFileSystem modified to accept optional registeredName parameter.

  • Modules/filesystem/DOMFileSystem.cpp:

(WebCore::DOMFileSystem::createIsolatedFileSystem):

  • Modules/filesystem/DOMFileSystem.h:

(DOMFileSystem):

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/InspectorFrontendClient.h:

(InspectorFrontendClient):

  • inspector/InspectorFrontendClientLocal.h:

(WebCore::InspectorFrontendClientLocal::supportsFileSystems):
(WebCore::InspectorFrontendClientLocal::requestFileSystems):
(WebCore::InspectorFrontendClientLocal::addFileSystem):
(WebCore::InspectorFrontendClientLocal::removeFileSystem):
(InspectorFrontendClientLocal):

  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::supportsFileSystems):
(WebCore):
(WebCore::InspectorFrontendHost::requestFileSystems):
(WebCore::InspectorFrontendHost::addFileSystem):
(WebCore::InspectorFrontendHost::removeFileSystem):
(WebCore::InspectorFrontendHost::isolatedFileSystem):

  • inspector/InspectorFrontendHost.h:

(WebCore):
(InspectorFrontendHost):

  • inspector/InspectorFrontendHost.idl:
  • inspector/compile-front-end.py:
  • inspector/front-end/FileSystemMapping.js: Added.
  • inspector/front-end/InspectorFrontendAPI.js:

(InspectorFrontendAPI.fileSystemsLoaded):
(InspectorFrontendAPI.fileSystemRemoved):
(InspectorFrontendAPI.fileSystemAdded):

  • inspector/front-end/InspectorFrontendHostStub.js:

(.WebInspector.InspectorFrontendHostStub.prototype.supportsFileSystems):
(.WebInspector.InspectorFrontendHostStub.prototype.requestFileSystems):
(.WebInspector.InspectorFrontendHostStub.prototype.addFileSystem):
(.WebInspector.InspectorFrontendHostStub.prototype.removeFileSystem):
(.WebInspector.InspectorFrontendHostStub.prototype.isolatedFileSystem):

  • inspector/front-end/IsolatedFileSystemModel.js: Added.
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/externs.js:

(DOMFileSystem):
(InspectorFrontendHostAPI.prototype.supportsFileSystems):
(InspectorFrontendHostAPI.prototype.requestFileSystems):
(InspectorFrontendHostAPI.prototype.addFileSystem):
(InspectorFrontendHostAPI.prototype.removeFileSystem):
(InspectorFrontendHostAPI.prototype.isolatedFileSystem):

  • inspector/front-end/inspector.html:
  • inspector/front-end/inspector.js:

Source/WebKit/chromium:

File system access methods plumbing made for Chromium.

  • public/WebDevToolsFrontendClient.h:

(WebKit::WebDevToolsFrontendClient::requestFileSystems):
(WebKit::WebDevToolsFrontendClient::addFileSystem):
(WebKit::WebDevToolsFrontendClient::removeFileSystem):
(WebDevToolsFrontendClient):

  • src/InspectorFrontendClientImpl.cpp:

(WebKit::InspectorFrontendClientImpl::supportsFileSystems):
(WebKit):
(WebKit::InspectorFrontendClientImpl::requestFileSystems):
(WebKit::InspectorFrontendClientImpl::addFileSystem):
(WebKit::InspectorFrontendClientImpl::removeFileSystem):

  • src/InspectorFrontendClientImpl.h:

(InspectorFrontendClientImpl):

Location:
trunk/Source
Files:
3 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139725 r139726  
     12012-12-28  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Support inspector file system access with isolated file system through InspectorFrontendHost.
     4        https://bugs.webkit.org/show_bug.cgi?id=105727
     5
     6        Reviewed by Pavel Feldman.
     7
     8        File system access through isolated file system is implemented in inspector.
     9        File system access requests are sent through InspectorFrontendHost.
     10        Introduced IsolatedFileSystemModel encapsulating file system access logic.
     11        Introduced FileSystemMapping that provides mapping between workspace uris and file system pathes.
     12        DOMFileSystem.createIsolatedFileSystem modified to accept optional registeredName parameter.
     13
     14        * Modules/filesystem/DOMFileSystem.cpp:
     15        (WebCore::DOMFileSystem::createIsolatedFileSystem):
     16        * Modules/filesystem/DOMFileSystem.h:
     17        (DOMFileSystem):
     18        * WebCore.gypi:
     19        * WebCore.vcproj/WebCore.vcproj:
     20        * inspector/InspectorFrontendClient.h:
     21        (InspectorFrontendClient):
     22        * inspector/InspectorFrontendClientLocal.h:
     23        (WebCore::InspectorFrontendClientLocal::supportsFileSystems):
     24        (WebCore::InspectorFrontendClientLocal::requestFileSystems):
     25        (WebCore::InspectorFrontendClientLocal::addFileSystem):
     26        (WebCore::InspectorFrontendClientLocal::removeFileSystem):
     27        (InspectorFrontendClientLocal):
     28        * inspector/InspectorFrontendHost.cpp:
     29        (WebCore::InspectorFrontendHost::supportsFileSystems):
     30        (WebCore):
     31        (WebCore::InspectorFrontendHost::requestFileSystems):
     32        (WebCore::InspectorFrontendHost::addFileSystem):
     33        (WebCore::InspectorFrontendHost::removeFileSystem):
     34        (WebCore::InspectorFrontendHost::isolatedFileSystem):
     35        * inspector/InspectorFrontendHost.h:
     36        (WebCore):
     37        (InspectorFrontendHost):
     38        * inspector/InspectorFrontendHost.idl:
     39        * inspector/compile-front-end.py:
     40        * inspector/front-end/FileSystemMapping.js: Added.
     41        * inspector/front-end/InspectorFrontendAPI.js:
     42        (InspectorFrontendAPI.fileSystemsLoaded):
     43        (InspectorFrontendAPI.fileSystemRemoved):
     44        (InspectorFrontendAPI.fileSystemAdded):
     45        * inspector/front-end/InspectorFrontendHostStub.js:
     46        (.WebInspector.InspectorFrontendHostStub.prototype.supportsFileSystems):
     47        (.WebInspector.InspectorFrontendHostStub.prototype.requestFileSystems):
     48        (.WebInspector.InspectorFrontendHostStub.prototype.addFileSystem):
     49        (.WebInspector.InspectorFrontendHostStub.prototype.removeFileSystem):
     50        (.WebInspector.InspectorFrontendHostStub.prototype.isolatedFileSystem):
     51        * inspector/front-end/IsolatedFileSystemModel.js: Added.
     52        * inspector/front-end/WebKit.qrc:
     53        * inspector/front-end/externs.js:
     54        (DOMFileSystem):
     55        (InspectorFrontendHostAPI.prototype.supportsFileSystems):
     56        (InspectorFrontendHostAPI.prototype.requestFileSystems):
     57        (InspectorFrontendHostAPI.prototype.addFileSystem):
     58        (InspectorFrontendHostAPI.prototype.removeFileSystem):
     59        (InspectorFrontendHostAPI.prototype.isolatedFileSystem):
     60        * inspector/front-end/inspector.html:
     61        * inspector/front-end/inspector.js:
     62
    1632013-01-15  Kondapally Kalyan  <kalyan.kondapally@intel.com>
    264
  • trunk/Source/WebCore/WebCore.gypi

    r139698 r139726  
    51465146            'inspector/front-end/ExtensionView.js',
    51475147            'inspector/front-end/FileManager.js',
     5148            'inspector/front-end/FileSystemMapping.js',
    51485149            'inspector/front-end/FileSystemModel.js',
    51495150            'inspector/front-end/FileUtils.js',
     
    51615162            'inspector/front-end/InspectorView.js',
    51625163            'inspector/front-end/inspector.js',
     5164            'inspector/front-end/IsolatedFileSystemModel.js',
    51635165            'inspector/front-end/JavaScriptFormatter.js',
    51645166            'inspector/front-end/jsdifflib.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r139666 r139726  
    7671876718                                </File>
    7671976719                                <File
     76720                                        RelativePath="..\inspector\front-end\FileSystemMapping.js"
     76721                                        >
     76722                                </File>
     76723                                <File
    7672076724                                        RelativePath="..\inspector\front-end\FileSystemModel.js"
    7672176725                                        >
     
    7685176855                                <File
    7685276856                                        RelativePath="..\inspector\front-end\InspectorView.js"
     76857                                        >
     76858                                </File>
     76859                                <File
     76860                                        RelativePath="..\inspector\front-end\IsolatedFileSystemModel.js"
    7685376861                                        >
    7685476862                                </File>
  • trunk/Source/WebCore/inspector/InspectorFrontendClient.h

    r132045 r139726  
    7272
    7373    virtual void sendMessageToBackend(const String&) = 0;
     74
     75    virtual bool supportsFileSystems() = 0;
     76    virtual void requestFileSystems() = 0;
     77    virtual void addFileSystem() = 0;
     78    virtual void removeFileSystem(const String& fileSystemPath) = 0;
    7479};
    7580
  • trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h

    r134346 r139726  
    7777    virtual void sendMessageToBackend(const String& message);
    7878
     79    virtual bool supportsFileSystems() { return false; }
     80    virtual void requestFileSystems() { }
     81    virtual void addFileSystem() { }
     82    virtual void removeFileSystem(const String&) { }
     83
    7984    bool canAttachWindow();
    8085    void setDockingUnavailable(bool);
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp

    r133862 r139726  
    3838#include "ContextMenuController.h"
    3939#include "ContextMenuProvider.h"
     40#include "DOMFileSystem.h"
    4041#include "Element.h"
    4142#include "Frame.h"
     
    295296}
    296297
     298bool InspectorFrontendHost::supportsFileSystems()
     299{
     300    if (m_client)
     301        return m_client->supportsFileSystems();
     302    return false;
     303}
     304
     305void InspectorFrontendHost::requestFileSystems()
     306{
     307    if (m_client)
     308        m_client->requestFileSystems();
     309}
     310
     311void InspectorFrontendHost::addFileSystem()
     312{
     313    if (m_client)
     314        m_client->addFileSystem();
     315}
     316
     317void InspectorFrontendHost::removeFileSystem(const String& fileSystemPath)
     318{
     319    if (m_client)
     320        m_client->removeFileSystem(fileSystemPath);
     321}
     322
     323#if ENABLE(FILE_SYSTEM)
     324PassRefPtr<DOMFileSystem> InspectorFrontendHost::isolatedFileSystem(const String& fileSystemName, const String& rootURL)
     325{
     326    ScriptExecutionContext* context = m_frontendPage->mainFrame()->document();
     327    return DOMFileSystem::create(context, fileSystemName, FileSystemTypeIsolated, KURL(ParsedURLString, rootURL), AsyncFileSystem::create());
     328}
     329#endif
     330
    297331} // namespace WebCore
    298332
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.h

    r132045 r139726  
    4040
    4141class ContextMenuItem;
     42class DOMFileSystem;
    4243class Event;
    4344class FrontendMenuProvider;
     
    8687    String loadResourceSynchronously(const String& url);
    8788
     89    bool supportsFileSystems();
     90    void requestFileSystems();
     91    void addFileSystem();
     92    void removeFileSystem(const String& fileSystemPath);
     93#if ENABLE(FILE_SYSTEM)
     94    PassRefPtr<DOMFileSystem> isolatedFileSystem(const String& fileSystemName, const String& rootURL);
     95#endif
     96
    8897private:
    8998#if ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.idl

    r132045 r139726  
    6767   
    6868    DOMString loadResourceSynchronously(in DOMString url);
     69
     70    boolean supportsFileSystems();
     71    void requestFileSystems();
     72    void addFileSystem();
     73    void removeFileSystem(in DOMString fileSystemPath);
     74    [Conditional=FILE_SYSTEM] DOMFileSystem isolatedFileSystem(in DOMString fileSystemId, in DOMString registeredName);
    6975};
  • trunk/Source/WebCore/inspector/compile-front-end.py

    r139414 r139726  
    7777            "DebuggerScriptMapping.js",
    7878            "FileManager.js",
     79            "FileSystemMapping.js",
    7980            "FileSystemModel.js",
    8081            "FileUtils.js",
     
    8283            "IndexedDBModel.js",
    8384            "InspectorBackend.js",
     85            "IsolatedFileSystemModel.js",
    8486            "Linkifier.js",
    8587            "NetworkLog.js",
  • trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js

    r138453 r139726  
    111111    },
    112112
     113    fileSystemsLoaded: function(fileSystems)
     114    {
     115        WebInspector.isolatedFileSystemDispatcher.fileSystemsLoaded(fileSystems);
     116    },
     117
     118    fileSystemRemoved: function(fileSystemPath)
     119    {
     120        WebInspector.isolatedFileSystemDispatcher.fileSystemRemoved(fileSystemPath);
     121    },
     122
     123    fileSystemAdded: function(errorMessage, fileSystem)
     124    {
     125        WebInspector.isolatedFileSystemDispatcher.fileSystemAdded(errorMessage, fileSystem);
     126    },
     127
    113128    savedURL: function(url)
    114129    {
  • trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js

    r133152 r139726  
    196196    },
    197197
     198    supportsFileSystems: function()
     199    {
     200        return false;
     201    },
     202
     203    requestFileSystems: function()
     204    {
     205    },
     206
     207    addFileSystem: function()
     208    {
     209    },
     210
     211    removeFileSystem: function(fileSystemPath)
     212    {
     213    },
     214
     215    isolatedFileSystem: function(fileSystemId, registeredName)
     216    {
     217        return null;
     218    },
     219
    198220    setZoomFactor: function(zoom)
    199221    {
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r139414 r139726  
    7575    <file>FileContentView.js</file>
    7676    <file>FileManager.js</file>
     77    <file>FileSystemMapping.js</file>
    7778    <file>FileSystemModel.js</file>
    7879    <file>FileSystemView.js</file>
     
    101102    <file>InspectorView.js</file>
    102103    <file>JSHeapSnapshot.js</file>
     104    <file>IsolatedFileSystemModel.js</file>
    103105    <file>JavaScriptFormatter.js</file>
    104106    <file>JavaScriptSourceFrame.js</file>
  • trunk/Source/WebCore/inspector/front-end/externs.js

    r138477 r139726  
    139139DOMApplicationCache.prototype.OBSOLETE = 5;
    140140
     141// File System API
     142/**
     143 * @constructor
     144 */
     145function DOMFileSystem() {}
     146
    141147/** @type {Node} */
    142148Range.prototype.startContainer;
     
    172178InspectorFrontendHostAPI.prototype.recordSettingChanged = function(settingCode) {}
    173179InspectorFrontendHostAPI.prototype.loadResourceSynchronously = function(url) {}
     180InspectorFrontendHostAPI.prototype.supportsFileSystems = function() {}
     181InspectorFrontendHostAPI.prototype.requestFileSystems = function() {}
     182InspectorFrontendHostAPI.prototype.addFileSystem = function() {}
     183InspectorFrontendHostAPI.prototype.removeFileSystem = function(fileSystemPath) {}
     184InspectorFrontendHostAPI.prototype.isolatedFileSystem = function(fileSystemId, registeredName) {}
    174185InspectorFrontendHostAPI.prototype.setZoomFactor = function(zoom) {}
    175186InspectorFrontendHostAPI.prototype.canInspectWorkers = function() {}
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r139414 r139726  
    138138    <script type="text/javascript" src="DebuggerScriptMapping.js"></script>
    139139    <script type="text/javascript" src="PresentationConsoleMessageHelper.js"></script>
     140    <script type="text/javascript" src="IsolatedFileSystemModel.js"></script>
     141    <script type="text/javascript" src="FileSystemMapping.js"></script>
    140142    <script type="text/javascript" src="Workspace.js"></script>
    141143    <script type="text/javascript" src="SimpleWorkspaceProvider.js"></script>
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r139454 r139726  
    431431    this.openAnchorLocationRegistry.registerHandler(autoselectPanel, function() { return false; });
    432432
     433    this.isolatedFileSystemModel = new WebInspector.IsolatedFileSystemModel();
     434    this.isolatedFileSystemDispatcher = new WebInspector.IsolatedFileSystemDispatcher(this.isolatedFileSystemModel);
    433435    this.workspace = new WebInspector.Workspace();
    434436    this.networkWorkspaceProvider = new WebInspector.SimpleWorkspaceProvider(this.workspace);
  • trunk/Source/WebKit/chromium/ChangeLog

    r139719 r139726  
     12012-12-28  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Support inspector file system access with isolated file system through InspectorFrontendHost.
     4        https://bugs.webkit.org/show_bug.cgi?id=105727
     5
     6        Reviewed by Pavel Feldman.
     7
     8        File system access methods plumbing made for Chromium.
     9
     10        * public/WebDevToolsFrontendClient.h:
     11        (WebKit::WebDevToolsFrontendClient::requestFileSystems):
     12        (WebKit::WebDevToolsFrontendClient::addFileSystem):
     13        (WebKit::WebDevToolsFrontendClient::removeFileSystem):
     14        (WebDevToolsFrontendClient):
     15        * src/InspectorFrontendClientImpl.cpp:
     16        (WebKit::InspectorFrontendClientImpl::supportsFileSystems):
     17        (WebKit):
     18        (WebKit::InspectorFrontendClientImpl::requestFileSystems):
     19        (WebKit::InspectorFrontendClientImpl::addFileSystem):
     20        (WebKit::InspectorFrontendClientImpl::removeFileSystem):
     21        * src/InspectorFrontendClientImpl.h:
     22        (InspectorFrontendClientImpl):
     23
    1242013-01-14  Dominic Cooney  <dominicc@chromium.org>
    225
  • trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h

    r131946 r139726  
    5454    virtual void append(const WebString& url, const WebString& content) { }
    5555
     56    virtual void requestFileSystems() { }
     57    virtual void addFileSystem() { }
     58    virtual void removeFileSystem(const WebString& fileSystemPath) { }
     59
    5660protected:
    5761    virtual ~WebDevToolsFrontendClient() {}
  • trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp

    r132045 r139726  
    155155}
    156156
     157bool InspectorFrontendClientImpl::supportsFileSystems()
     158{
     159    return true;
     160}
     161
     162void InspectorFrontendClientImpl::requestFileSystems()
     163{
     164    m_client->requestFileSystems();
     165}
     166
     167void InspectorFrontendClientImpl::addFileSystem()
     168{
     169    m_client->addFileSystem();
     170}
     171
     172void InspectorFrontendClientImpl::removeFileSystem(const String& fileSystemPath)
     173{
     174    m_client->removeFileSystem(fileSystemPath);
     175}
     176
     177
    157178} // namespace WebKit
  • trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h

    r132045 r139726  
    7676
    7777    virtual void sendMessageToBackend(const WTF::String&);
     78
     79    virtual bool supportsFileSystems();
     80    virtual void requestFileSystems();
     81    virtual void addFileSystem();
     82    virtual void removeFileSystem(const String& fileSystemPath);
    7883private:
    7984    WebCore::Page* m_frontendPage;
Note: See TracChangeset for help on using the changeset viewer.