Commit c763e4c4 authored by beidson@apple.com's avatar beidson@apple.com

Reviewed and landed by Brady Eidson.

Source/WebCore: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878

Created StorageTracker as a central point for tracking and deleting LocalStorage per origin.
StorageTracker maintains its own database of origin identifiers and backing db paths,
and this allows it to contain more relational data in the future, like variable quotas per origin.

On initialization, StorageTracker syncs its database with LocalStorage files on disk. It adds
an origin entry when StorageAreaSync performs a first sync for an origin.

All StorageTracker file operations are performed on one background thread with a task queue.

Tests: storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html
       storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html
       storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html
       storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html
       storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html

* GNUmakefile.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* page/PageGroup.cpp:
(WebCore::PageGroup::clearLocalStorageForAllOrigins):
(WebCore::PageGroup::clearLocalStorageForOrigin):
(WebCore::PageGroup::syncLocalStorage):
(WebCore::PageGroup::numberOfPageGroups):
* page/PageGroup.h:
* platform/chromium/FileSystemChromium.cpp:
(WebCore::listDirectory):
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::listDirectory):
* storage/LocalStorageTask.cpp:
(WebCore::LocalStorageTask::LocalStorageTask):
(WebCore::LocalStorageTask::performTask):
* storage/LocalStorageTask.h:
(WebCore::LocalStorageTask::createOriginIdentifiersImport):
(WebCore::LocalStorageTask::createSetOriginDetails):
(WebCore::LocalStorageTask::createDeleteOrigin):
(WebCore::LocalStorageTask::createDeleteAllOrigins):
* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::clearForOriginDeletion):
(WebCore::StorageAreaImpl::sync):
* storage/StorageAreaImpl.h:
* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::scheduleCloseDatabase):
(WebCore::StorageAreaSync::openDatabase):
(WebCore::StorageAreaSync::sync):
(WebCore::StorageAreaSync::deleteEmptyDatabase):
(WebCore::StorageAreaSync::scheduleSync):
* storage/StorageAreaSync.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::clearOriginForDeletion):
(WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion):
(WebCore::StorageNamespaceImpl::sync):
* storage/StorageNamespaceImpl.h:
* storage/StorageTracker.cpp: Added.
(WebCore::StorageTracker::initializeTracker):
(WebCore::StorageTracker::tracker):
(WebCore::StorageTracker::StorageTracker):
(WebCore::StorageTracker::setStorageDirectoryPath):
(WebCore::StorageTracker::trackerDatabasePath):
(WebCore::StorageTracker::openTrackerDatabase):
(WebCore::StorageTracker::importOriginIdentifiers):
(WebCore::StorageTracker::syncImportOriginIdentifiers):
(WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
(WebCore::StorageTracker::setOriginDetails):
(WebCore::StorageTracker::scheduleTask):
(WebCore::StorageTracker::syncSetOriginDetails):
(WebCore::StorageTracker::origins):
(WebCore::StorageTracker::deleteAllOrigins):
(WebCore::StorageTracker::syncDeleteAllOrigins):
(WebCore::StorageTracker::deleteOrigin):
(WebCore::StorageTracker::syncDeleteOrigin):
(WebCore::StorageTracker::willDeleteAllOrigins):
(WebCore::StorageTracker::willDeleteOrigin):
(WebCore::StorageTracker::canDeleteOrigin):
(WebCore::StorageTracker::cancelDeletingOrigin):
(WebCore::StorageTracker::setClient):
(WebCore::StorageTracker::syncLocalStorage):
* storage/StorageTracker.h: Added.
* storage/StorageTrackerClient.h: Added.
(WebCore::StorageTrackerClient::~StorageTrackerClient):

Source/WebKit: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/chromium: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878

* src/StorageNamespaceProxy.cpp:
(WebCore::StorageNamespaceProxy::clearOriginForDeletion):
(WebCore::StorageNamespaceProxy::clearAllOriginsForDeletion):
(WebCore::StorageNamespaceProxy::sync):
* src/StorageNamespaceProxy.h:

Source/WebKit/mac: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
https://bugs.webkit.org/show_bug.cgi?id=51878
Add WebKit1 API to view and delete local storage

* Storage/WebStorageManager.mm: Added.
(+[WebStorageManager sharedWebStorageManager]):
(-[WebStorageManager origins]):
(-[WebStorageManager deleteAllOrigins]):
(-[WebStorageManager deleteOrigin:]):
(-[WebStorageManager syncLocalStorage]):
(-[WebStorageManager syncFileSystemAndTrackerDatabase]):
(storageDirectoryPath):
(WebKitInitializeStorageIfNecessary):
* Storage/WebStorageManagerInternal.h: Added.
* Storage/WebStorageManagerPrivate.h: Added.
* Storage/WebStorageTrackerClient.h: Added.
* Storage/WebStorageTrackerClient.mm: Added.
(WebStorageTrackerClient::sharedWebStorageTrackerClient):
(WebStorageTrackerClient::WebStorageTrackerClient):
(WebStorageTrackerClient::~WebStorageTrackerClient):
(WebStorageTrackerClient::dispatchDidModifyOriginOnMainThread):
(WebStorageTrackerClient::dispatchDidModifyOrigin):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin protocol]):
(-[WebSecurityOrigin host]):
(-[WebSecurityOrigin databaseIdentifier]):
(-[WebSecurityOrigin domain]):
(-[WebSecurityOrigin _initWithWebCoreSecurityOrigin:]):
* WebCoreSupport/WebSecurityOriginPrivate.h:
* WebKit.exp:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):

Tools: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
https://bugs.webkit.org/show_bug.cgi?id=51878
Add WebKit1 API to view and delete local storage

Added tests that write to LocalStorage, delete one origin, get list of origins with local storage, delete all origins.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/LayoutTestController.cpp:
(syncLocalStorageCallback):
(observeStorageTrackerNotificationsCallback):
(deleteAllLocalStorageCallback):
(deleteLocalStorageForOriginCallback):
(originsWithLocalStorageCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/StorageTrackerDelegate.h: Added.
* DumpRenderTree/StorageTrackerDelegate.mm: Added.
(-[StorageTrackerDelegate init]):
(-[StorageTrackerDelegate logNotifications:controller:]):
(-[StorageTrackerDelegate originModified:]):
(-[StorageTrackerDelegate dealloc]):
(-[StorageTrackerDelegate setControllerToNotifyDone:]):
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):
(observeStorageTrackerNotifications):
(syncLocalStorage):
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):
(LayoutTestController::observeStorageTrackerNotifications):
(LayoutTestController::syncLocalStorage):
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetDefaultsToConsistentValues):
(allocateGlobalControllers):
(releaseGlobalControllers):
* DumpRenderTree/mac/DumpRenderTreeMac.h:
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::syncLocalStorage):
(LayoutTestController::observeStorageTrackerNotifications):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):
(LayoutTestController::observeStorageTrackerNotifications):
(LayoutTestController::syncLocalStorage):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::clearAllApplicationCaches):
(LayoutTestController::syncLocalStorage):
(LayoutTestController::observeStorageTrackerNotifications):
(LayoutTestController::clearAllDatabases):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:
(LayoutTestController::syncLocalStorage):
(LayoutTestController::observeStorageTrackerNotifications):
(LayoutTestController::clearAllDatabases):
(LayoutTestController::deleteAllLocalStorage):
(LayoutTestController::originsWithLocalStorage):
(LayoutTestController::deleteLocalStorageForOrigin):

LayoutTests: 

Patch by Anton D'Auria <adauria@apple.com> on 2011-03-11
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878

* platform/chromium/test_expectations.txt:
* storage/domstorage/localstorage/storagetracker: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 26803352
2011-03-11 Anton D'Auria <adauria@apple.com>
Reviewed and landed by Brady Eidson.
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878
* platform/chromium/test_expectations.txt:
* storage/domstorage/localstorage/storagetracker: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt: Added.
* storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html: Added.
2011-03-11 Jessie Berlin <jberlin@apple.com>
http/tests/websocket/tests/url-with-credential.html sometimes crashes beneath SocketStreamHandle::readStreamCallback on Windows
......@@ -151,6 +151,10 @@ WONTFIX SKIP : fast/wml = FAIL
// most likely these tests will always be JSC specific.
WONTFIX SKIP : fast/profiler = FAIL TIMEOUT
// StorageTracker isn't used by Chromium and not all requisite platform code
// is implemented.
WONTFIX SKIP : storage/domstorage/localstorage/storagetracker = PASS TIMEOUT FAIL
// We use worker_uitests to run workers tests. Don't run them in test_shell.
WONTFIX SKIP : fast/workers = PASS TIMEOUT FAIL
WONTFIX SKIP : fast/files/workers = PASS TIMEOUT FAIL
......
Prepare for StorageTracker tests by ensuring that every origin with local storage is deleted.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
This test should have no visible output on success.
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Prepare for StorageTracker tests by ensuring that every origin with local storage is deleted.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function finishTest() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function test()
{
if (!window.localStorage) {
testFailed("localStorage DOES NOT exist");
return;
}
debug("This test should have no visible output on success.");
if (layoutTestController.originsWithLocalStorage().length > 0) {
layoutTestController.observeStorageTrackerNotifications(1);
layoutTestController.deleteAllLocalStorage();
} else {
finishTest();
}
}
test();
window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>
Origin identifier: 'file__0'
StorageTracker test - write local storage for this origin. Should be called after origins-prepare.html.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("StorageTracker test - write local storage for this origin. Should be called after origins-prepare.html.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function finishTest() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function test()
{
if (!window.localStorage) {
testFailed("localStorage DOES NOT exist");
return;
}
if (layoutTestController.originsWithLocalStorage().length > 0) {
// An origin already exists so we can exit.
testFailed("An origin already existed with local storage.");
layoutTestController.notifyDone();
} else {
layoutTestController.syncLocalStorage();
localStorage.someData = 'writeme';
// LayoutTestController's notifyDone will be called after the origin change notification comes in.
layoutTestController.observeStorageTrackerNotifications(1);
}
}
test();
window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>
Test API to view origins that have local storage and to delete local storage by origin.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS layoutTestController.originsWithLocalStorage().toString() is "file__0"
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test API to view origins that have local storage and to delete local storage by origin.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function finishTest() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function test()
{
if (!window.localStorage) {
testFailed("localStorage DOES NOT exist");
return;
}
if (layoutTestController.originsWithLocalStorage().length > 0) {
shouldBeEqualToString("layoutTestController.originsWithLocalStorage().toString()", "file__0");
// We're just going to delete the existing origin, so we'll get one origin change notification.
layoutTestController.observeStorageTrackerNotifications(1);
layoutTestController.deleteAllLocalStorage();
} else {
layoutTestController.notifyDone();
testFailed("Ran with no origins with local storage");
}
// At this point, we're guaranteed to have one origin with local storage.
}
test();
window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>
Origin identifier: 'file__0'
StorageTracker test - write local storage for this origin. Should be called after storage-tracker-3-delete-all.html.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
This test should have no visible output on success.
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("StorageTracker test - write local storage for this origin. Should be called after storage-tracker-3-delete-all.html.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function finishTest() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function test()
{
if (!window.localStorage) {
testFailed("localStorage DOES NOT exist");
return;
}
debug("This test should have no visible output on success.");
if (layoutTestController.originsWithLocalStorage().length > 0) {
// An origin already exists so we can exit.
testFailed("An origin already existed with local storage.");
layoutTestController.notifyDone();
} else {
layoutTestController.syncLocalStorage();
localStorage.someOtherData = 'writemeMore';
layoutTestController.observeStorageTrackerNotifications(1);
}
}
test();
window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>
Test API to view origins that have local storage and to delete local storage by origin.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS layoutTestController.originsWithLocalStorage().toString() is "file__0"
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
<script src="../../../../fast/js/resources/js-test-pre.js"></script>
<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test API to view origins that have local storage and to delete local storage by origin.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
function finishTest() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function test()
{
if (!window.localStorage) {
testFailed("localStorage DOES NOT exist");
return;
}
if (layoutTestController.originsWithLocalStorage().length > 0) {
shouldBeEqualToString("layoutTestController.originsWithLocalStorage().toString()", "file__0");
// We're just going to delete the existing origin, so we'll get one origin change notification.
layoutTestController.observeStorageTrackerNotifications(1);
// At this point, we're guaranteed to have one origin with local storage.
layoutTestController.deleteLocalStorageForOrigin("file://");
} else {
testFailed("Ran with no origins with local storage.");
layoutTestController.notifyDone();
}
}
test();
window.successfullyParsed = true;
isSuccessfullyParsed();
</script>
</body>
</html>
2011-03-11 Anton D'Auria <adauria@apple.com>
Reviewed and landed by Brady Eidson.
Add WebKit1 API to view and delete local storage
https://bugs.webkit.org/show_bug.cgi?id=51878
Created StorageTracker as a central point for tracking and deleting LocalStorage per origin.
StorageTracker maintains its own database of origin identifiers and backing db paths,
and this allows it to contain more relational data in the future, like variable quotas per origin.
On initialization, StorageTracker syncs its database with LocalStorage files on disk. It adds
an origin entry when StorageAreaSync performs a first sync for an origin.
All StorageTracker file operations are performed on one background thread with a task queue.
Tests: storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html
storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html
storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html
storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html
storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html
* GNUmakefile.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* page/PageGroup.cpp:
(WebCore::PageGroup::clearLocalStorageForAllOrigins):
(WebCore::PageGroup::clearLocalStorageForOrigin):
(WebCore::PageGroup::syncLocalStorage):
(WebCore::PageGroup::numberOfPageGroups):
* page/PageGroup.h:
* platform/chromium/FileSystemChromium.cpp:
(WebCore::listDirectory):
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::listDirectory):
* storage/LocalStorageTask.cpp:
(WebCore::LocalStorageTask::LocalStorageTask):
(WebCore::LocalStorageTask::performTask):
* storage/LocalStorageTask.h:
(WebCore::LocalStorageTask::createOriginIdentifiersImport):
(WebCore::LocalStorageTask::createSetOriginDetails):
(WebCore::LocalStorageTask::createDeleteOrigin):
(WebCore::LocalStorageTask::createDeleteAllOrigins):
* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::clearForOriginDeletion):
(WebCore::StorageAreaImpl::sync):
* storage/StorageAreaImpl.h:
* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::scheduleCloseDatabase):
(WebCore::StorageAreaSync::openDatabase):
(WebCore::StorageAreaSync::sync):
(WebCore::StorageAreaSync::deleteEmptyDatabase):
(WebCore::StorageAreaSync::scheduleSync):
* storage/StorageAreaSync.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::clearOriginForDeletion):
(WebCore::StorageNamespaceImpl::clearAllOriginsForDeletion):
(WebCore::StorageNamespaceImpl::sync):
* storage/StorageNamespaceImpl.h:
* storage/StorageTracker.cpp: Added.
(WebCore::StorageTracker::initializeTracker):
(WebCore::StorageTracker::tracker):
(WebCore::StorageTracker::StorageTracker):
(WebCore::StorageTracker::setStorageDirectoryPath):
(WebCore::StorageTracker::trackerDatabasePath):
(WebCore::StorageTracker::openTrackerDatabase):
(WebCore::StorageTracker::importOriginIdentifiers):
(WebCore::StorageTracker::syncImportOriginIdentifiers):
(WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
(WebCore::StorageTracker::setOriginDetails):
(WebCore::StorageTracker::scheduleTask):
(WebCore::StorageTracker::syncSetOriginDetails):
(WebCore::StorageTracker::origins):
(WebCore::StorageTracker::deleteAllOrigins):
(WebCore::StorageTracker::syncDeleteAllOrigins):
(WebCore::StorageTracker::deleteOrigin):
(WebCore::StorageTracker::syncDeleteOrigin):
(WebCore::StorageTracker::willDeleteAllOrigins):
(WebCore::StorageTracker::willDeleteOrigin):
(WebCore::StorageTracker::canDeleteOrigin):
(WebCore::StorageTracker::cancelDeletingOrigin):
(WebCore::StorageTracker::setClient):
(WebCore::StorageTracker::syncLocalStorage):
* storage/StorageTracker.h: Added.
* storage/StorageTrackerClient.h: Added.
(WebCore::StorageTrackerClient::~StorageTrackerClient):
2011-03-11 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
......
......@@ -3218,6 +3218,9 @@ webcore_sources += \
Source/WebCore/storage/StorageNamespaceImpl.h \
Source/WebCore/storage/StorageSyncManager.cpp \
Source/WebCore/storage/StorageSyncManager.h \
Source/WebCore/storage/StorageTracker.cpp \
Source/WebCore/storage/StorageTracker.h \
Source/WebCore/storage/StorageTrackerClient.h \
Source/WebCore/svg/animation/SMILTimeContainer.cpp \
Source/WebCore/svg/animation/SMILTimeContainer.h \
Source/WebCore/svg/animation/SMILTime.cpp \
......
......@@ -969,6 +969,7 @@ __ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
__ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
__ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldEPNS_15DOMWrapperWorldE
__ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
__ZN7WebCore9PageGroup18numberOfPageGroupsEv
__ZN7WebCore9Scrollbar22maxOverlapBetweenPagesEv
__ZN7WebCore9TimerBase4stopEv
__ZN7WebCore9TimerBase5startEdd
......@@ -1092,6 +1093,16 @@ __ZNK7WebCore14ResourceLoader11frameLoaderEv
__ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
__ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
__ZNK7WebCore14SecurityOrigin5equalEPKS0_
#if ENABLE(DOM_STORAGE)
__ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringE
__ZN7WebCore14StorageTracker16deleteAllOriginsEv
__ZN7WebCore14StorageTracker12deleteOriginEPNS_14SecurityOriginE
__ZN7WebCore14StorageTracker7trackerEv
__ZN7WebCore14StorageTracker7originsERN3WTF6VectorINS1_6RefPtrINS_14SecurityOriginEEELm0EEE
__ZN7WebCore14StorageTracker9setClientEPNS_20StorageTrackerClientE
__ZN7WebCore14StorageTracker16syncLocalStorageEv
__ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv
#endif
__ZNK7WebCore15FocusController18focusedOrMainFrameEv
__ZNK7WebCore15GraphicsContext15platformContextEv
__ZNK7WebCore15GraphicsContext16paintingDisabledEv
......
......@@ -4635,6 +4635,8 @@
'storage/StorageNamespaceImpl.h',
'storage/StorageSyncManager.cpp',
'storage/StorageSyncManager.h',
'storage/StorageTracker.cpp',
'storage/StorageTracker.h',
'storage/chromium/DatabaseObserver.h',
'storage/chromium/DatabaseTrackerChromium.cpp',
'storage/chromium/IDBFactoryBackendInterface.cpp',
......
......@@ -2748,7 +2748,9 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
storage/StorageMap.h \
storage/StorageNamespace.h \
storage/StorageNamespaceImpl.h \
storage/StorageSyncManager.h
storage/StorageSyncManager.h \
storage/StorageTracker.h \
storage/StorageTrackerClient.h
!v8 {
SOURCES += \
......@@ -2765,7 +2767,8 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
storage/StorageMap.cpp \
storage/StorageNamespace.cpp \
storage/StorageNamespaceImpl.cpp \
storage/StorageSyncManager.cpp
storage/StorageSyncManager.cpp \
storage/StorageTracker.cpp
}
contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
......
......@@ -65894,9 +65894,18 @@
>
</File>
<File
RelativePath="..\storage\VersionChangeCallback.h"
RelativePath="..\storage\StorageTracker.cpp"
>
</File>
<File
RelativePath="..\storage\StorageTracker.h"
>
</File>
<File
RelativePath="..\storage\VersionChangeCallback.h"
>
</File>
</Filter>
<Filter
Name="strings"
......@@ -870,6 +870,9 @@
37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */; };
37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FD4297118368460093C029 /* TreeDepthLimit.h */; };
3AB02D2A12D4F91600FBB694 /* StorageTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AB02D2812D4F91600FBB694 /* StorageTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
3AB02D2B12D4F91600FBB694 /* StorageTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3AB02D2912D4F91600FBB694 /* StorageTracker.cpp */; };
3AC3680012EF7A09006A3D6F /* StorageTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AC367FE12EF7A09006A3D6F /* StorageTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
3AC648B2129E146500C3EB25 /* EditingBoundary.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AC648B1129E146500C3EB25 /* EditingBoundary.h */; settings = {ATTRIBUTES = (Private, ); }; };
41002CCD0F66EDEF009E660D /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */; };
41002CCE0F66EDEF009E660D /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */; };
......@@ -7282,6 +7285,9 @@
37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponse.mm; sourceTree = "<group>"; };
37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingFloatsRootInlineBox.h; sourceTree = "<group>"; };
37FD4297118368460093C029 /* TreeDepthLimit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeDepthLimit.h; sourceTree = "<group>"; };
3AB02D2812D4F91600FBB694 /* StorageTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageTracker.h; sourceTree = "<group>"; };
3AB02D2912D4F91600FBB694 /* StorageTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageTracker.cpp; sourceTree = "<group>"; };
3AC367FE12EF7A09006A3D6F /* StorageTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageTrackerClient.h; sourceTree = "<group>"; };
3AC648B1129E146500C3EB25 /* EditingBoundary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBoundary.h; sourceTree = "<group>"; };
41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; };
41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; };
......@@ -13043,6 +13049,9 @@
C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */,
C5102D930FD9AA2D00FAFF04 /* StorageSyncManager.cpp */,
C5102D920FD9AA2D00FAFF04 /* StorageSyncManager.h */,
3AB02D2812D4F91600FBB694 /* StorageTracker.h */,
3AB02D2912D4F91600FBB694 /* StorageTracker.cpp */,
3AC367FE12EF7A09006A3D6F /* StorageTrackerClient.h */,
);
indentWidth = 4;
path = storage;
......@@ -22151,6 +22160,7 @@
C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */,
C55E38BF10040D5D00A56BDB /* StorageNamespaceImpl.h in Headers */,
C5102D940FD9AA2D00FAFF04 /* StorageSyncManager.h in Headers */,
3AB02D2A12D4F91600FBB694 /* StorageTracker.h in Headers */,
65488D6B0DD5A83D009D83B2 /* StringSourceProvider.h in Headers */,
B23540F30D00782E002382FA /* StringTruncator.h in Headers */,
849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */,
......@@ -22645,6 +22655,7 @@
E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */,
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
3AC3680012EF7A09006A3D6F /* StorageTrackerClient.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSFilter.h in Headers */,
E49BD9FA131FD2ED003C56F0 /* CSSPrimitiveValueCache.h in Headers */,
5A574F25131DB93900471B88 /* RenderQuote.h in Headers */,
......@@ -24932,6 +24943,7 @@
C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */,
C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */,
C5102D950FD9AA2D00FAFF04 /* StorageSyncManager.cpp in Sources */,
3AB02D2B12D4F91600FBB694 /* StorageTracker.cpp in Sources */,
B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */,
B2B2645C0D00A77E000ACC1D /* StringCF.cpp in Sources */,
B2B2645D0D00A77E000ACC1D /* StringImplCF.cpp in Sources */,
......@@ -33,6 +33,7 @@
#include "GroupSettings.h"
#include "IDBFactoryBackendInterface.h"
#include "Page.h"
#include "SecurityOrigin.h"
#include "Settings.h"
#include "StorageNamespace.h"
......@@ -110,6 +111,54 @@ void PageGroup::closeLocalStorage()
#endif
}
#if ENABLE(DOM_STORAGE)
void PageGroup::clearLocalStorageForAllOrigins()
{
if (!pageGroups)
return;
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
if (it->second->hasLocalStorage())
it->second->localStorage()->clearAllOriginsForDeletion();
}
}
void PageGroup::clearLocalStorageForOrigin(SecurityOrigin* origin)
{
if (!pageGroups)
return;
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
if (it->second->hasLocalStorage())
it->second->localStorage()->clearOriginForDeletion(origin);
}
}
void PageGroup::syncLocalStorage()
{
if (!pageGroups)
return;
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
if (it->second->hasLocalStorage())
it->second->localStorage()->sync();
}
}
unsigned PageGroup::numberOfPageGroups()
{
if (!pageGroups)
return 0;
return pageGroups->size();
}
#endif
void PageGroup::addPage(Page* page)
{
ASSERT(page);
......@@ -209,6 +258,7 @@ StorageNamespace* PageGroup::localStorage()
return m_localStorage.get();
}
#endif
#if ENABLE(INDEXED_DATABASE)
...