Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 7745011: Remove --unlimited-quota-for-indexeddb. Increase incognito quota. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another rebase Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_context.cc ('k') | content/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
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 bf1481331e53d51655a4779d46d60ed335ded2d3..ff9d31fe828115cdae34d280d9884cca56edc133 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(
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_context.cc ('k') | content/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698