Changeset 91931 in webkit
- Timestamp:
- Jul 28, 2011, 8:32:40 AM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91929 r91931 1 2011-07-28 Brady Eidson <beidson@apple.com> 2 3 <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306 4 WebKitInitializeStorageIfNecessary() can take awhile performing i/o, isn't necessary for every WebView 5 6 Move the heavy lifting done in StorageTracker::initializeTracker() until when the global tracker is actually 7 accessed, therefore deferring it until a web page actually uses LocalStorage or the app uses the API. 8 9 Reviewed by Maciej Stachowiak. 10 11 No new tests. (Not possible to test this API implementation detail) 12 13 * WebCore.exp.in: 14 15 * storage/StorageAreaImpl.cpp: 16 (WebCore::StorageAreaImpl::StorageAreaImpl): Access the global StorageTracker to indicate that a web page 17 is actually using the storage APIs. 18 19 * storage/StorageTracker.cpp: 20 (WebCore::StorageTracker::initializeTracker): Moved the potentially hefty work from here... 21 (WebCore::StorageTracker::internalInitialize): ...to here. 22 (WebCore::StorageTracker::tracker): If the global tracker hasn't had internalInitialize() called, do so. 23 (WebCore::StorageTracker::StorageTracker): 24 * storage/StorageTracker.h: 25 1 26 2011-07-28 Carlos Garcia Campos <cgarcia@igalia.com> 2 27 -
trunk/Source/WebCore/WebCore.exp.in
r91777 r91931 1437 1437 __ZN7WebCore14StorageTracker16deleteAllOriginsEv 1438 1438 __ZN7WebCore14StorageTracker16syncLocalStorageEv 1439 __ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringE 1439 __ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringEPNS_20StorageTrackerClientE 1440 1440 __ZN7WebCore14StorageTracker18diskUsageForOriginEPNS_14SecurityOriginE 1441 1441 __ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv -
trunk/Source/WebCore/storage/StorageAreaImpl.cpp
r87597 r91931 38 38 #include "StorageMap.h" 39 39 #include "StorageSyncManager.h" 40 #include "StorageTracker.h" 40 41 41 42 namespace WebCore { … … 58 59 ASSERT(m_securityOrigin); 59 60 ASSERT(m_storageMap); 61 62 // Accessing the shared global StorageTracker when a StorageArea is created 63 // ensures that the tracker is properly initialized before anyone actually needs to use it. 64 StorageTracker::tracker(); 60 65 } 61 66 -
trunk/Source/WebCore/storage/StorageTracker.cpp
r86772 r91931 49 49 static StorageTracker* storageTracker = 0; 50 50 51 void StorageTracker::initializeTracker(const String& storagePath )51 void StorageTracker::initializeTracker(const String& storagePath, StorageTrackerClient* client) 52 52 { 53 53 ASSERT(isMainThread()); … … 57 57 storageTracker = new StorageTracker(storagePath); 58 58 59 storageTracker->m_client = client; 60 } 61 62 void StorageTracker::internalInitialize() 63 { 64 ASSERT(isMainThread()); 65 59 66 // Make sure text encoding maps have been built on the main thread, as the StorageTracker thread might try to do it there instead. 60 67 // FIXME (<rdar://problem/9127819>): Is there a more explicit way of doing this besides accessing the UTF8Encoding? … … 65 72 storageTracker->m_thread->start(); 66 73 storageTracker->importOriginIdentifiers(); 74 75 m_isInitialized = true; 67 76 } 68 77 … … 71 80 if (!storageTracker) 72 81 storageTracker = new StorageTracker(""); 82 if (!storageTracker->m_isInitialized) 83 storageTracker->internalInitialize(); 73 84 74 85 return *storageTracker; … … 76 87 77 88 StorageTracker::StorageTracker(const String& storagePath) 78 : m_client(0) 89 : m_storageDirectoryPath(storagePath.threadsafeCopy()) 90 , m_client(0) 79 91 , m_thread(LocalStorageThread::create()) 80 92 , m_isActive(false) 81 { 82 setStorageDirectoryPath(storagePath); 83 } 84 85 void StorageTracker::setStorageDirectoryPath(const String& path) 86 { 87 MutexLocker lockDatabase(m_databaseGuard); 88 ASSERT(!m_database.isOpen()); 89 90 m_storageDirectoryPath = path.threadsafeCopy(); 93 , m_isInitialized(false) 94 { 91 95 } 92 96 -
trunk/Source/WebCore/storage/StorageTracker.h
r86205 r91931 47 47 WTF_MAKE_FAST_ALLOCATED; 48 48 public: 49 static void initializeTracker(const String& storagePath );49 static void initializeTracker(const String& storagePath, StorageTrackerClient*); 50 50 static StorageTracker& tracker(); 51 static void scheduleTask(void*);52 51 53 void importOriginIdentifiers();54 52 void setOriginDetails(const String& originIdentifier, const String& databaseFile); 55 53 … … 77 75 private: 78 76 StorageTracker(const String& storagePath); 77 static void scheduleTask(void*); 78 79 void internalInitialize(); 79 80 80 81 String trackerDatabasePath(); 81 82 void openTrackerDatabase(bool createIfDoesNotExist); 82 83 83 void setStorageDirectoryPath(const String&);84 84 void importOriginIdentifiers(); 85 85 86 void deleteTrackerFiles(); 86 87 String databasePathForOrigin(const String& originIdentifier); … … 112 113 113 114 bool m_isActive; 115 bool m_isInitialized; 114 116 }; 115 117 -
trunk/Source/WebKit/mac/ChangeLog
r91903 r91931 1 2011-07-28 Brady Eidson <beidson@apple.com> 2 3 <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306 4 WebKitInitializeStorageIfNecessary() can take awhile performing i/o, isn't necessary for every WebView 5 6 Reviewed by Maciej Stachowiak. 7 8 * Storage/WebStorageManager.mm: 9 (WebKitInitializeStorageIfNecessary): Pass the client along in initializeTracker(). 10 1 11 2011-07-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 12 -
trunk/Source/WebKit/mac/Storage/WebStorageManager.mm
r86205 r91931 107 107 return; 108 108 109 StorageTracker::initializeTracker(storageDirectoryPath()); 110 111 StorageTracker::tracker().setClient(WebStorageTrackerClient::sharedWebStorageTrackerClient()); 112 109 StorageTracker::initializeTracker(storageDirectoryPath(), WebStorageTrackerClient::sharedWebStorageTrackerClient()); 110 113 111 initialized = YES; 114 112 } -
trunk/Source/WebKit2/ChangeLog
r91903 r91931 1 2011-07-28 Brady Eidson <beidson@apple.com> 2 3 <rdar://problem/9714337> and https://bugs.webkit.org/show_bug.cgi?id=65306 4 WebKitInitializeStorageIfNecessary() can take awhile performing i/o, isn't necessary for every WebView 5 6 Reviewed by Maciej Stachowiak. 7 8 * WebProcess/WebProcess.cpp: 9 (WebKit::WebProcess::initializeWebProcess): Pass a null client pointer in the new form of initializeTracker() 10 1 11 2011-07-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 12 -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r89706 r91931 193 193 194 194 #if ENABLE(DOM_STORAGE) 195 StorageTracker::initializeTracker(parameters.localStorageDirectory );195 StorageTracker::initializeTracker(parameters.localStorageDirectory, 0); 196 196 m_localStorageDirectory = parameters.localStorageDirectory; 197 197 #endif
Note:
See TracChangeset
for help on using the changeset viewer.