diff options
author | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-26 23:40:51 +0000 |
---|---|---|
committer | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-26 23:40:51 +0000 |
commit | 5428b28fc413a250479fe1ae58372c789ec66eb7 (patch) | |
tree | 738af865b2b60bdd8318885cf2a2b9bcc635b9a0 /content/browser/in_process_webkit | |
parent | 3de5113a89bfa6685ed88fb04523e31db28c4288 (diff) | |
download | chromium_src-5428b28fc413a250479fe1ae58372c789ec66eb7.zip chromium_src-5428b28fc413a250479fe1ae58372c789ec66eb7.tar.gz chromium_src-5428b28fc413a250479fe1ae58372c789ec66eb7.tar.bz2 |
Remove --unlimited-quota-for-indexeddb. Increase incognito quota.
Incognito / SQLite's quota is now 50mb. We'll have to figure out what to do for quota for LevelDB's incognito mode when it's implemented.
BUG=94187
TEST=llvm/Debug/browser_tests --gtest_filter=IndexedDB*
Review URL: http://codereview.chromium.org/7745011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98522 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/in_process_webkit')
4 files changed, 7 insertions, 30 deletions
diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index ee5386c..6ccd65f 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -32,10 +32,6 @@ class IndexedDBBrowserTest : public InProcessBrowserTest { EnableDOMAutomation(); } - virtual void SetUpCommandLine(CommandLine* command_line) { - command_line->AppendSwitch(switches::kUnlimitedQuotaForIndexedDB); - } - GURL testUrl(const FilePath& file_path) { const FilePath kTestDir(FILE_PATH_LITERAL("indexeddb")); return ui_test_utils::GetTestUrl(kTestDir, file_path); diff --git a/content/browser/in_process_webkit/indexed_db_context.cc b/content/browser/in_process_webkit/indexed_db_context.cc index 3249ba8..39837d6 100644 --- a/content/browser/in_process_webkit/indexed_db_context.cc +++ b/content/browser/in_process_webkit/indexed_db_context.cc @@ -176,11 +176,6 @@ void IndexedDBContext::DeleteIndexedDBForOrigin(const GURL& origin_url) { } } -bool IndexedDBContext::IsUnlimitedStorageGranted( - const GURL& origin) const { - return special_storage_policy_->IsStorageUnlimited(origin); -} - void IndexedDBContext::GetAllOrigins(std::vector<GURL>* origins) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); std::set<GURL>* origins_set = GetOriginSet(); diff --git a/content/browser/in_process_webkit/indexed_db_context.h b/content/browser/in_process_webkit/indexed_db_context.h index dd8ad0f..1504b72 100644 --- a/content/browser/in_process_webkit/indexed_db_context.h +++ b/content/browser/in_process_webkit/indexed_db_context.h @@ -59,9 +59,6 @@ class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { // Deletes all indexed db files for the given origin. void DeleteIndexedDBForOrigin(const GURL& origin_url); - // Does a particular origin get unlimited storage? - bool IsUnlimitedStorageGranted(const GURL& origin_url) const; - // Methods used in response to QuotaManager requests. void GetAllOrigins(std::vector<GURL>* origins); int64 GetOriginDiskUsage(const GURL& origin_url); diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index bf14813..ff9d31f 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -46,10 +46,6 @@ using WebKit::WebVector; namespace { -// FIXME: Replace this magic constant once we have a more sophisticated quota -// system. -static const uint64 kDefaultQuota = 5 * 1024 * 1024; - template <class T> void DeleteOnWebKitThread(T* obj) { if (!BrowserThread::DeleteSoon(BrowserThread::WEBKIT, FROM_HERE, obj)) @@ -203,23 +199,13 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( // TODO(jorlow): This doesn't support file:/// urls properly. We probably need // to add some toString method to WebSecurityOrigin that doesn't - // return null for them. + // return null for them. Look at + // DatabaseUtil::GetOriginFromIdentifier. WebSecurityOrigin origin( WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); GURL origin_url(origin.toString()); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); - DCHECK(kDefaultQuota == params.maximum_size); - - uint64 quota = kDefaultQuota; - if (Context()->IsUnlimitedStorageGranted(origin_url) || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kUnlimitedQuotaForIndexedDB)) { - // TODO(jorlow): For the IsUnlimitedStorageGranted case, we need some - // way to revoke it. - // TODO(jorlow): Use kint64max once we think we can scale over 1GB. - quota = 1024 * 1024 * 1024; // 1GB. More or less "unlimited". - } WebKit::WebIDBFactory::BackingStoreType backingStoreType = WebKit::WebIDBFactory::LevelDBBackingStore; @@ -229,14 +215,17 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( backingStoreType = WebKit::WebIDBFactory::SQLiteBackingStore; } + // TODO(dgrogan): Delete this magic constant once we've removed sqlite. + static const uint64 kIncognitoSqliteBackendQuota = 50 * 1024 * 1024; + // TODO(dgrogan): Don't let a non-existing database be opened (and therefore // created) if this origin is already over quota. Context()->GetIDBFactory()->open( params.name, new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id, origin_url), - origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path), quota, - backingStoreType); + origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path), + kIncognitoSqliteBackendQuota, backingStoreType); } void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( |