diff options
-rw-r--r-- | content/browser/in_process_webkit/indexed_db_browsertest.cc | 4 | ||||
-rw-r--r-- | content/browser/in_process_webkit/indexed_db_context.cc | 5 | ||||
-rw-r--r-- | content/browser/in_process_webkit/indexed_db_context.h | 3 | ||||
-rw-r--r-- | content/browser/in_process_webkit/indexed_db_dispatcher_host.cc | 25 | ||||
-rw-r--r-- | content/common/content_switches.cc | 5 | ||||
-rw-r--r-- | content/common/content_switches.h | 1 | ||||
-rw-r--r-- | content/common/indexed_db_messages.h | 2 | ||||
-rw-r--r-- | content/renderer/indexed_db_dispatcher.cc | 4 | ||||
-rw-r--r-- | content/renderer/indexed_db_dispatcher.h | 3 | ||||
-rw-r--r-- | content/renderer/renderer_webidbfactory_impl.cc | 4 | ||||
-rw-r--r-- | content/renderer/renderer_webidbfactory_impl.h | 1 |
11 files changed, 12 insertions, 45 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( diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc index c77bc74..452b4f3 100644 --- a/content/common/content_switches.cc +++ b/content/common/content_switches.cc @@ -420,11 +420,6 @@ const char kTestSandbox[] = "test-sandbox"; // TODO(dumi): remove the switch when we have a real quota implementation. const char kUnlimitedQuotaForFiles[] = "unlimited-quota-for-files"; -// This is for testing IndexedDB and will give any website you visit unlimited -// quota in IndexedDB. This should only be used for development and not general -// browsing. It is ignored in single process mode. -const char kUnlimitedQuotaForIndexedDB[] = "unlimited-quota-for-indexeddb"; - // A string used to override the default user agent with a custom one. const char kUserAgent[] = "user-agent"; diff --git a/content/common/content_switches.h b/content/common/content_switches.h index a0d196a..a1a8807 100644 --- a/content/common/content_switches.h +++ b/content/common/content_switches.h @@ -135,7 +135,6 @@ extern const char kSingleProcess[]; extern const char kSQLiteIndexedDatabase[]; extern const char kTestSandbox[]; extern const char kUnlimitedQuotaForFiles[]; -extern const char kUnlimitedQuotaForIndexedDB[]; extern const char kUserAgent[]; extern const char kUtilityCmdPrefix[]; extern const char kUtilityProcess[]; diff --git a/content/common/indexed_db_messages.h b/content/common/indexed_db_messages.h index b27fb53..8347b01 100644 --- a/content/common/indexed_db_messages.h +++ b/content/common/indexed_db_messages.h @@ -30,8 +30,6 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryOpen_Params) IPC_STRUCT_MEMBER(string16, origin) // The name of the database. IPC_STRUCT_MEMBER(string16, name) - // The maximum size of the database. - IPC_STRUCT_MEMBER(uint64, maximum_size) IPC_STRUCT_END() // Used to delete an indexed database. diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc index f137a83..eb00ac3 100644 --- a/content/renderer/indexed_db_dispatcher.cc +++ b/content/renderer/indexed_db_dispatcher.cc @@ -105,8 +105,7 @@ void IndexedDBDispatcher::RequestIDBFactoryOpen( const string16& name, WebIDBCallbacks* callbacks_ptr, const string16& origin, - WebFrame* web_frame, - uint64 maximum_size) { + WebFrame* web_frame) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); if (!web_frame) @@ -120,7 +119,6 @@ void IndexedDBDispatcher::RequestIDBFactoryOpen( params.response_id = pending_callbacks_.Add(callbacks.release()); params.origin = origin; params.name = name; - params.maximum_size = maximum_size; RenderThread::current()->Send(new IndexedDBHostMsg_FactoryOpen(params)); } diff --git a/content/renderer/indexed_db_dispatcher.h b/content/renderer/indexed_db_dispatcher.h index 59d774b..edfd9a7 100644 --- a/content/renderer/indexed_db_dispatcher.h +++ b/content/renderer/indexed_db_dispatcher.h @@ -37,8 +37,7 @@ class IndexedDBDispatcher : public IPC::Channel::Listener { const string16& name, WebKit::WebIDBCallbacks* callbacks, const string16& origin, - WebKit::WebFrame* web_frame, - uint64 maximum_size); + WebKit::WebFrame* web_frame); void RequestIDBFactoryDeleteDatabase( const string16& name, diff --git a/content/renderer/renderer_webidbfactory_impl.cc b/content/renderer/renderer_webidbfactory_impl.cc index bd0800c..98102d6 100644 --- a/content/renderer/renderer_webidbfactory_impl.cc +++ b/content/renderer/renderer_webidbfactory_impl.cc @@ -28,14 +28,14 @@ void RendererWebIDBFactoryImpl::open( const WebSecurityOrigin& origin, WebFrame* web_frame, const WebString& data_dir, - unsigned long long maximum_size, + unsigned long long maximum_size_unused, WebKit::WebIDBFactory::BackingStoreType) { // Don't send the data_dir. We know what we want on the Browser side of // things. IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); dispatcher->RequestIDBFactoryOpen( - name, callbacks, origin.databaseIdentifier(), web_frame, maximum_size); + name, callbacks, origin.databaseIdentifier(), web_frame); } void RendererWebIDBFactoryImpl::deleteDatabase( diff --git a/content/renderer/renderer_webidbfactory_impl.h b/content/renderer/renderer_webidbfactory_impl.h index 29572c6..2837911 100644 --- a/content/renderer/renderer_webidbfactory_impl.h +++ b/content/renderer/renderer_webidbfactory_impl.h @@ -30,6 +30,7 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { const WebKit::WebSecurityOrigin& origin, WebKit::WebFrame* web_frame, const WebKit::WebString& data_dir, + // TODO(dgrogan): Remove maximum_size after it's out of the webkit api. unsigned long long maximum_size, WebKit::WebIDBFactory::BackingStoreType); // FIXME(jochen): remove after webkit roll. |