From 45c56d58e1fa736d57fb8bc9deaed44123386ade Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> Date: Sat, 25 May 2013 15:52:21 +0000 Subject: Revert 202215 "Migrate the IndexedDB backend from Blink to Chromium" > Migrate the IndexedDB backend from Blink to Chromium > > To get the IDB backend off the (deprecated) WebKit thread, remove > intermediate proxying, and let us take advantage of base utilities, > we're moving the code from Blink to Chromium. > > This patch is basically a glorified copy/paste of the Blink IDB > backend code, with Chromium coding style applied, WTF dependencies > replaced with STL and base/, redundant classes removed, etc. It > introduces some new temporary proxy classes > (content/browser/webidb*_impl.*) to allow us build both the old and > new backends. > > The new backend is currently disabled by default. It can be enabled > using a new (and temporary) command line switch: --new-indexeddb Once > we've done some further cleanup and are confident that the new backend > is stable, and the bots have moved from DumpRenderTree to > content_shell, we'll switch to the new backend by default. Once that > has survived through a dev channel release, we'll delete the Blink > code and eliminate unnecessary proxy classes. > > BUG=234278 > R=alecflett@chromium.org, dgrogan@chromium.org, piman@chromium.org > > Review URL: https://codereview.chromium.org/15564008 TBR=jsbell@chromium.org Review URL: https://codereview.chromium.org/15870003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202302 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/indexed_db/indexed_db_unittest.cc | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'content/browser/indexed_db/indexed_db_unittest.cc') diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 93bd9f8..e45f4b4 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -55,9 +55,10 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { // Create some indexedDB paths. // With the levelDB backend, these are directories. - IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context) - ->GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = + static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context)-> + GetIndexedDBContext()); // Override the storage policy with our own. idb_context->special_storage_policy_ = special_storage_policy; @@ -98,9 +99,10 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { // Create some indexedDB paths. // With the levelDB backend, these are directories. - IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context) - ->GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = + static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context)-> + GetIndexedDBContext()); // Override the storage policy with our own. idb_context->special_storage_policy_ = special_storage_policy; @@ -126,16 +128,20 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { EXPECT_TRUE(file_util::DirectoryExists(session_only_path)); } -class MockWebIDBDatabase : public WebKit::WebIDBDatabase { +class MockWebIDBDatabase : public WebKit::WebIDBDatabase +{ public: MockWebIDBDatabase(bool expect_force_close) - : expect_force_close_(expect_force_close), force_close_called_(false) {} + : expect_force_close_(expect_force_close), + force_close_called_(false) {} - virtual ~MockWebIDBDatabase() { + virtual ~MockWebIDBDatabase() + { EXPECT_TRUE(force_close_called_ == expect_force_close_); } - virtual void forceClose() { + virtual void forceClose() + { ASSERT_TRUE(expect_force_close_); force_close_called_ = true; } @@ -145,6 +151,7 @@ class MockWebIDBDatabase : public WebKit::WebIDBDatabase { bool force_close_called_; }; + TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -158,9 +165,10 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { const GURL kTestOrigin("http://test/"); - IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context) - ->GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = + static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context)-> + GetIndexedDBContext()); idb_context->quota_manager_proxy_ = NULL; idb_context->set_data_path_for_testing(temp_dir.path()); -- cgit v1.1