Changeset 70956 in webkit
- Timestamp:
- Oct 29, 2010 4:57:20 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/CMakeLists.txt
r70904 r70956 1120 1120 inspector/InspectorDatabaseResource.cpp 1121 1121 inspector/InspectorDebuggerAgent.cpp 1122 inspector/InspectorFileSystemAgent.cpp 1122 1123 inspector/InspectorFrontendClientLocal.cpp 1123 1124 inspector/InspectorFrontendHost.cpp -
trunk/WebCore/ChangeLog
r70945 r70956 1 2010-10-29 Kavita Kanetkar <kkanetkar@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: FileSystem integration 6 https://bugs.webkit.org/show_bug.cgi?id=45982 7 8 Adding filesystem support for Inspector under storage tab. This fetches root paths for 9 temporary and persistent filesystems and allows "reveal folder in OS" option that 10 launches native file browser. Currently this feature is disabled for non-chromium platforms. 11 12 * CMakeLists.txt: 13 * English.lproj/localizedStrings.js: 14 * GNUmakefile.am: 15 * WebCore.gypi: 16 * WebCore.pro: 17 * WebCore.vcproj/WebCore.vcproj: 18 * inspector/CodeGeneratorInspector.pm: 19 * inspector/Inspector.idl: 20 * inspector/InspectorController.cpp: 21 (WebCore::InspectorController::connectFrontend): 22 (WebCore::InspectorController::releaseFrontendLifetimeAgents): 23 * inspector/InspectorController.h: 24 (WebCore::InspectorController::fileSystemAgent): 25 * inspector/InspectorFileSystemAgent.cpp: Added. 26 * inspector/InspectorFileSystemAgent.h: Added. 27 * inspector/front-end/FileSystemView.js: Added. 28 * inspector/front-end/Settings.js: 29 * inspector/front-end/StoragePanel.js: 30 (WebInspector.StoragePanel): 31 (WebInspector.StoragePanel.prototype.reset): 32 (WebInspector.StoragePanel.prototype.addFileSystem): 33 (WebInspector.StoragePanel.prototype.showFileSystem): 34 (WebInspector.StoragePanel.prototype.updateFileSystemPath): 35 (WebInspector.StoragePanel.prototype.updateFileSystemError): 36 (WebInspector.FileSystemTreeElement): 37 (WebInspector.FileSystemTreeElement.prototype.onselect): 38 * inspector/front-end/WebKit.qrc: 39 * inspector/front-end/inspector.css: 40 (.file-system-storage-tree-item .icon): 41 * inspector/front-end/inspector.html: 42 * inspector/front-end/inspector.js: 43 (WebInspector.updateResource): 44 (WebInspector._addFileSystemOrigin): 45 (WebInspector.didGetFileSystemPath): 46 (WebInspector.didGetFileSystemError): 47 (WebInspector.reset): 48 * platform/AsyncFileSystem.h: 49 (WebCore::AsyncFileSystem::root): 50 * platform/FileSystem.h: 51 * platform/chromium/ChromiumBridge.h: 52 * platform/chromium/FileSystemChromium.cpp: 53 (WebCore::revealFolderInOS): 54 1 55 2010-10-29 Ryosuke Niwa <rniwa@webkit.org> 2 56 -
trunk/WebCore/GNUmakefile.am
r70904 r70956 1845 1845 WebCore/inspector/InspectorDOMStorageResource.cpp \ 1846 1846 WebCore/inspector/InspectorDOMStorageResource.h \ 1847 WebCore/inspector/InspectorFileSystemAgent.cpp \ 1848 WebCore/inspector/InspectorFileSystemAgent.h \ 1847 1849 WebCore/inspector/InspectorFrontendClient.h \ 1848 1850 WebCore/inspector/InspectorFrontendClientLocal.cpp \ -
trunk/WebCore/WebCore.gypi
r70904 r70956 1947 1947 'inspector/InspectorDOMStorageResource.cpp', 1948 1948 'inspector/InspectorDOMStorageResource.h', 1949 'inspector/InspectorFileSystemAgent.cpp', 1950 'inspector/InspectorFileSystemAgent.h', 1949 1951 'inspector/InspectorFrontendClient.h', 1950 1952 'inspector/InspectorFrontendHost.cpp', … … 4420 4422 'inspector/front-end/ExtensionRegistryStub.js', 4421 4423 'inspector/front-end/ExtensionServer.js', 4424 'inspector/front-end/FileSystemView.js', 4422 4425 'inspector/front-end/FontView.js', 4423 4426 'inspector/front-end/GoToLineDialog.js', -
trunk/WebCore/WebCore.pro
r70904 r70956 1011 1011 inspector/InspectorDOMAgent.cpp \ 1012 1012 inspector/InspectorDOMStorageResource.cpp \ 1013 inspector/InspectorFileSystemAgent.cpp \ 1013 1014 inspector/InspectorFrontendClientLocal.cpp \ 1014 1015 inspector/InspectorFrontendHost.cpp \ … … 1893 1894 inspector/InspectorDebuggerAgent.h \ 1894 1895 inspector/InspectorDOMStorageResource.h \ 1896 inspector/InspectorFileSystemAgent.h \ 1895 1897 inspector/InspectorFrontendClient.h \ 1896 1898 inspector/InspectorFrontendClientLocal.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r70904 r70956 63769 63769 </File> 63770 63770 <File 63771 RelativePath="..\inspector\InspectorFileSystemAgent.h" 63772 > 63773 </File> 63774 <File 63775 RelativePath="..\inspector\InspectorFileSystemAgent.cpp" 63776 > 63777 </File> 63778 <File 63771 63779 RelativePath="..\inspector\InspectorFrontendClient.h" 63772 63780 > … … 64045 64053 <File 64046 64054 RelativePath="..\inspector\front-end\ExtensionServer.js" 64055 > 64056 </File> 64057 <File 64058 RelativePath="..\inspector\front-end\FileSystemView.js" 64047 64059 > 64048 64060 </File> -
trunk/WebCore/inspector/CodeGeneratorInspector.pm
r69948 r70956 43 43 "header" => "InspectorApplicationCacheAgent.h", 44 44 "domainAccessor" => "m_inspectorController->applicationCacheAgent()", 45 }; 46 $typeTransform{"FileSystem"} = { 47 "forward" => "InspectorFileSystemAgent", 48 "header" => "InspectorFileSystemAgent.h", 49 "domainAccessor" => "m_inspectorController->fileSystemAgent()", 45 50 }; 46 51 $typeTransform{"Profiler"} = { -
trunk/WebCore/inspector/Inspector.idl
r70929 r70956 218 218 #endif 219 219 220 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM 221 [handler=FileSystem] void getFileSystemPathAsync(in unsigned int type, in String origin); 222 [handler=FileSystem] void revealFolderInOS(in String path); 223 [notify] void didGetFileSystemPath(out String root, out int type, out String origin); 224 [notify] void didGetFileSystemError(out int type, out String origin); 225 #endif 226 220 227 [handler=Backend] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup); 221 228 [handler=Controller] void didEvaluateForTestInFrontend(in long testCallId, in String jsonResult); -
trunk/WebCore/inspector/InspectorController.cpp
r70929 r70956 115 115 #endif 116 116 117 #if ENABLE(FILE_SYSTEM) 118 #include "InspectorFileSystemAgent.h" 119 #endif 120 117 121 #if ENABLE(DOM_STORAGE) 118 122 #include "Storage.h" … … 501 505 #endif 502 506 507 #if ENABLE(FILE_SYSTEM) 508 m_fileSystemAgent = InspectorFileSystemAgent::create(this, m_frontend.get()); 509 #endif 510 503 511 if (!InspectorInstrumentation::hasFrontends()) 504 512 ScriptController::setCaptureCallStackForUncaughtExceptions(true); … … 605 613 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 606 614 m_applicationCacheAgent.clear(); 615 #endif 616 617 #if ENABLE(FILE_SYSTEM) 618 if (m_fileSystemAgent) 619 m_fileSystemAgent->stop(); 620 m_fileSystemAgent.clear(); 607 621 #endif 608 622 } -
trunk/WebCore/inspector/InspectorController.h
r70929 r70956 97 97 #endif 98 98 99 #if ENABLE(FILE_SYSTEM) 100 class InspectorFileSystemAgent; 101 #endif 102 99 103 #if ENABLE(WEB_SOCKETS) 100 104 class WebSocketHandshakeRequest; … … 194 198 InspectorApplicationCacheAgent* applicationCacheAgent() { return m_applicationCacheAgent.get(); } 195 199 #endif 200 201 #if ENABLE(FILE_SYSTEM) 202 InspectorFileSystemAgent* fileSystemAgent() { return m_fileSystemAgent.get(); } 203 #endif 196 204 197 205 void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&); … … 359 367 OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent; 360 368 #endif 369 370 #if ENABLE(FILE_SYSTEM) 371 RefPtr<InspectorFileSystemAgent> m_fileSystemAgent; 372 #endif 373 361 374 RefPtr<Node> m_nodeToFocus; 362 375 #if LEGACY_RESOURCE_TRACKING_ENABLED -
trunk/WebCore/inspector/front-end/Settings.js
r70929 r70956 47 47 resourceExportEnabled: false, 48 48 networkPanelEnabled: false, 49 fileSystemEnabled: false, 49 50 useDataURLForResourceImageIcons: true 50 51 } -
trunk/WebCore/inspector/front-end/StoragePanel.js
r70879 r70956 63 63 this.applicationCacheListTreeElement.expand(); 64 64 65 if (Preferences.fileSystemEnabled) { 66 this.fileSystemListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("File System"), "file-system-storage-tree-item"); 67 this.sidebarTree.appendChild(this.fileSystemListTreeElement); 68 this.fileSystemListTreeElement.expand(); 69 } 70 65 71 this.storageViews = document.createElement("div"); 66 72 this.storageViews.id = "storage-views"; … … 103 109 104 110 this._cookieViews = {}; 105 111 112 this._fileSystemView = null; 113 106 114 this._applicationCacheView = null; 107 115 delete this._cachedApplicationCacheViewStatus; … … 112 120 this.cookieListTreeElement.removeChildren(); 113 121 this.applicationCacheListTreeElement.removeChildren(); 114 122 if (Preferences.fileSystemEnabled) 123 this.fileSystemListTreeElement.removeChildren(); 115 124 this.storageViews.removeChildren(); 116 125 … … 230 239 }, 231 240 241 addFileSystem: function(origin) 242 { 243 var fileSystemTreeElement = new WebInspector.FileSystemTreeElement(this, origin); 244 this.fileSystemListTreeElement.appendChild(fileSystemTreeElement); 245 }, 246 232 247 selectDatabase: function(databaseId) 233 248 { … … 353 368 }, 354 369 370 showFileSystem: function(treeElement, fileSystemDomain) 371 { 372 this._fileSystemView = new WebInspector.FileSystemView(treeElement, fileSystemDomain); 373 this._innerShowView(this._fileSystemView); 374 }, 375 355 376 showCategoryView: function(categoryName) 356 377 { … … 501 522 }, 502 523 524 updateFileSystemPath: function(root, type, origin) 525 { 526 if (this._fileSystemView && this._fileSystemView === this.visibleView) 527 this._fileSystemView.updateFileSystemPath(root, type, origin); 528 }, 529 530 updateFileSystemError: function(type, origin) 531 { 532 if (this._fileSystemView && this._fileSystemView === this.visibleView) 533 this._fileSystemView.updateFileSystemError(type, origin); 534 }, 535 503 536 updateNetworkState: function(isNowOnline) 504 537 { … … 922 955 WebInspector.ApplicationCacheTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; 923 956 957 WebInspector.FileSystemTreeElement = function(storagePanel, fileSystemDomain) 958 { 959 WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, fileSystemDomain ? fileSystemDomain : WebInspector.UIString("Local Files"), "file-system-storage-tree-item"); 960 this._fileSystemDomain = fileSystemDomain; 961 } 962 963 WebInspector.FileSystemTreeElement.prototype = { 964 onselect: function() 965 { 966 this._storagePanel.showFileSystem(this, this._fileSystemDomain); 967 } 968 } 969 970 WebInspector.FileSystemTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; 971 924 972 WebInspector.StorageCategoryView = function() 925 973 { -
trunk/WebCore/inspector/front-end/WebKit.qrc
r70240 r70956 42 42 <file>ExtensionRegistryStub.js</file> 43 43 <file>ExtensionServer.js</file> 44 <file>FileSystemView.js</file> 44 45 <file>FontView.js</file> 45 46 <file>GoToLineDialog.js</file> -
trunk/WebCore/inspector/front-end/inspector.css
r70529 r70956 1933 1933 } 1934 1934 1935 /* FIXME: Make separate png for file-system */ 1936 .file-system-storage-tree-item .icon { 1937 content: url(Images/applicationCache.png); 1938 } 1939 1935 1940 #storage-views { 1936 1941 position: absolute; -
trunk/WebCore/inspector/front-end/inspector.html
r70137 r70956 70 70 <script type="text/javascript" src="CookieItemsView.js"></script> 71 71 <script type="text/javascript" src="ApplicationCacheItemsView.js"></script> 72 <script type="text/javascript" src="FileSystemView.js"></script> 72 73 <script type="text/javascript" src="Script.js"></script> 73 74 <script type="text/javascript" src="BreakpointManager.js"></script> -
trunk/WebCore/inspector/front-end/inspector.js
r70929 r70956 53 53 cookieDomains: {}, 54 54 applicationCacheDomains: {}, 55 fileSystemOrigins: {}, 55 56 missingLocalizedStrings: {}, 56 57 pendingDispatches: 0, … … 1298 1299 this._addCookieDomain(parsedURL.host); 1299 1300 this._addAppCacheDomain(parsedURL.host); 1301 if (Preferences.fileSystemEnabled) 1302 // This should match the SecurityOrigin::toString(). FIXME: Add a test for this. 1303 this._addFileSystemOrigin(parsedURL.scheme + "://" + parsedURL.host + (parsedURL.port ? (":" + parsedURL.port) : "")); 1300 1304 } 1301 1305 } … … 1414 1418 } 1415 1419 1420 WebInspector._addFileSystemOrigin = function(origin) 1421 { 1422 if (!this.panels.storage) 1423 return; 1424 // Eliminate duplicate origins. 1425 // FIXME: Move appcache/cookies/filesystem domain dup checks in StoragePanel.js 1426 if (origin in this.fileSystemOrigins) 1427 return; 1428 this.fileSystemOrigins[origin] = true; 1429 this.panels.storage.addFileSystem(origin); 1430 } 1431 1416 1432 WebInspector.addDOMStorage = function(payload) 1417 1433 { … … 1435 1451 } 1436 1452 1453 WebInspector.didGetFileSystemPath = function(root, type, origin) 1454 { 1455 this.panels.storage.updateFileSystemPath(root, type, origin); 1456 } 1457 1458 WebInspector.didGetFileSystemError = function(type, origin) 1459 { 1460 this.panels.storage.updateFileSystemError(type, origin); 1461 } 1462 1437 1463 WebInspector.updateNetworkState = function(isNowOnline) 1438 1464 { … … 1516 1542 this.cookieDomains = {}; 1517 1543 this.applicationCacheDomains = {}; 1544 this.fileSystemOrigins = {}; 1518 1545 this.highlightDOMNode(0); 1519 1546 -
trunk/WebCore/platform/AsyncFileSystem.h
r69485 r70956 129 129 virtual String virtualToPlatformPath(const String& path) const; 130 130 131 // Getter for this file system's root path. 132 String root() const { return m_platformRootPath; } 133 131 134 protected: 132 135 AsyncFileSystem(const String& platformRootPath) -
trunk/WebCore/platform/FileSystem.h
r66255 r70956 145 145 #endif 146 146 147 void revealFolderInOS(const String&); 147 148 bool fileExists(const String&); 148 149 bool deleteFile(const String&); -
trunk/WebCore/platform/chromium/ChromiumBridge.h
r69673 r70956 122 122 123 123 // File --------------------------------------------------------------- 124 static void revealFolderInOS(const String&); 124 125 static bool fileExists(const String&); 125 126 static bool deleteFile(const String&); -
trunk/WebCore/platform/chromium/FileSystemChromium.cpp
r58599 r70956 58 58 } 59 59 60 void revealFolderInOS(const String& path) 61 { 62 ChromiumBridge::revealFolderInOS(path); 63 } 64 60 65 String directoryName(const String& path) 61 66 { -
trunk/WebKit/chromium/ChangeLog
r70931 r70956 1 2010-10-29 Kavita Kanetkar <kkanetkar@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: FileSystem integration 6 https://bugs.webkit.org/show_bug.cgi?id=45982 7 8 * public/WebFileUtilities.h: 9 (WebKit::WebFileUtilities::revealFolderInOS): 10 * src/ChromiumBridge.cpp: 11 (WebCore::ChromiumBridge::revealFolderInOS): 12 13 1 14 2010-10-29 Darin Adler <darin@apple.com> 2 15 -
trunk/WebKit/chromium/public/WebFileUtilities.h
r65485 r70956 49 49 typedef int FileHandle; 50 50 #endif 51 51 virtual void revealFolderInOS(const WebString& path) { } 52 52 virtual bool fileExists(const WebString& path) { return false; } 53 53 virtual bool deleteFile(const WebString& path) { return false; } -
trunk/WebKit/chromium/src/ChromiumBridge.cpp
r70153 r70956 346 346 } 347 347 348 void ChromiumBridge::revealFolderInOS(const String& path) 349 { 350 webKitClient()->fileUtilities()->revealFolderInOS(path); 351 } 352 348 353 bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) 349 354 { -
trunk/WebKit/chromium/src/js/DevTools.js
r69098 r70956 47 47 Preferences.onlineDetectionEnabled = false; 48 48 Preferences.nativeInstrumentationEnabled = true; 49 // FIXME: Turn this to whatever the value of --enable-file-system for chrome. 50 Preferences.fileSystemEnabled = false; 49 51 })(); 50 52
Note: See TracChangeset
for help on using the changeset viewer.