diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 12:28:58 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 12:28:58 +0000 |
commit | e1dd56245e0d9e0c5ff69b7a14a61f3f010ac50e (patch) | |
tree | 8ebb4521cc02357580b05336f991f35a245f3cb6 /content | |
parent | ddb92f133c7776004575d4c9c52cf709f5082dcc (diff) | |
download | chromium_src-e1dd56245e0d9e0c5ff69b7a14a61f3f010ac50e.zip chromium_src-e1dd56245e0d9e0c5ff69b7a14a61f3f010ac50e.tar.gz chromium_src-e1dd56245e0d9e0c5ff69b7a14a61f3f010ac50e.tar.bz2 |
Deprecate WEBKIT thread
BUG=106839
TEST=try servers pass
Review URL: http://codereview.chromium.org/8879013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
19 files changed, 126 insertions, 111 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index fad569e..4826be7 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -319,7 +319,7 @@ void BrowserMainLoop::RunMainMessageLoopParts( case BrowserThread::DB: thread_to_start = &db_thread_; break; - case BrowserThread::WEBKIT: + case BrowserThread::WEBKIT_DEPRECATED: // Special case as WebKitThread is a separate // type. |thread_to_start| is not used in this case. break; @@ -366,7 +366,7 @@ void BrowserMainLoop::RunMainMessageLoopParts( if (parts_.get()) parts_->PreStartThread(id); - if (thread_id == BrowserThread::WEBKIT) { + if (thread_id == BrowserThread::WEBKIT_DEPRECATED) { webkit_thread_.reset(new WebKitThread); webkit_thread_->Initialize(); } else if (thread_to_start) { @@ -448,7 +448,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { case BrowserThread::DB: thread_to_stop = &db_thread_; break; - case BrowserThread::WEBKIT: + case BrowserThread::WEBKIT_DEPRECATED: // Special case as WebKitThread is a separate // type. |thread_to_stop| is not used in this case. break; @@ -484,7 +484,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { if (parts_.get()) parts_->PreStopThread(id); - if (id == BrowserThread::WEBKIT) { + if (id == BrowserThread::WEBKIT_DEPRECATED) { webkit_thread_.reset(); } else if (thread_to_stop) { thread_to_stop->reset(); diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index f37c5b4..94ef3f1 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -19,7 +19,7 @@ namespace { static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = { "", // UI (name assembled in browser_main.cc). "Chrome_DBThread", // DB - "Chrome_WebKitThread", // WEBKIT + "Chrome_WebKitThread", // WEBKIT_DEPRECATED "Chrome_FileThread", // FILE "Chrome_FileUserBlockingThread", // FILE_USER_BLOCKING "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index be9e103..59ec5f7 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -104,7 +104,7 @@ TEST_F(BrowserThreadTest, Release) { TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeleted) { bool deleted = false; BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, new DummyTask(&deleted)); EXPECT_TRUE(deleted); } @@ -152,7 +152,8 @@ TEST_F(BrowserThreadTest, PostTaskAndReply) { TEST_F(BrowserThreadTest, TaskToNonExistentThreadIsDeletedViaMessageLoopProxy) { bool deleted = false; scoped_refptr<base::MessageLoopProxy> message_loop_proxy = - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED); message_loop_proxy->PostTask(FROM_HERE, new DummyTask(&deleted)); EXPECT_TRUE(deleted); } diff --git a/content/browser/in_process_webkit/dom_storage_browsertest.cc b/content/browser/in_process_webkit/dom_storage_browsertest.cc index 469c503..2456399 100644 --- a/content/browser/in_process_webkit/dom_storage_browsertest.cc +++ b/content/browser/in_process_webkit/dom_storage_browsertest.cc @@ -47,7 +47,8 @@ IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, ClearLocalState) { // Make sure we wait until the destructor has run. scoped_refptr<base::ThreadTestHelper> helper( new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED))); ASSERT_TRUE(helper->Run()); // Because we specified https for scheme to be skipped the second file diff --git a/content/browser/in_process_webkit/dom_storage_context.cc b/content/browser/in_process_webkit/dom_storage_context.cc index 065d8cf..c276d76 100644 --- a/content/browser/in_process_webkit/dom_storage_context.cc +++ b/content/browser/in_process_webkit/dom_storage_context.cc @@ -90,7 +90,7 @@ DOMStorageContext::~DOMStorageContext() { // Not being on the WEBKIT thread here means we are running in a unit test // where no clean up is needed. - if (BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { + if (BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)) { ClearLocalState(data_path_.Append(kLocalStorageDirectory), special_storage_policy_, clear_local_state_on_exit_); @@ -98,7 +98,7 @@ DOMStorageContext::~DOMStorageContext() { } int64 DOMStorageContext::AllocateStorageAreaId() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); return ++last_storage_area_id_; } @@ -109,31 +109,31 @@ int64 DOMStorageContext::AllocateSessionStorageNamespaceId() { } int64 DOMStorageContext::CloneSessionStorage(int64 original_id) { - DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); int64 clone_id = AllocateSessionStorageNamespaceId(); BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&DOMStorageContext::CompleteCloningSessionStorage, this, original_id, clone_id)); return clone_id; } void DOMStorageContext::RegisterStorageArea(DOMStorageArea* storage_area) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); int64 id = storage_area->id(); DCHECK(!GetStorageArea(id)); storage_area_map_[id] = storage_area; } void DOMStorageContext::UnregisterStorageArea(DOMStorageArea* storage_area) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); int64 id = storage_area->id(); DCHECK(GetStorageArea(id)); storage_area_map_.erase(id); } DOMStorageArea* DOMStorageContext::GetStorageArea(int64 id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); StorageAreaMap::iterator iter = storage_area_map_.find(id); if (iter == storage_area_map_.end()) return NULL; @@ -141,7 +141,7 @@ DOMStorageArea* DOMStorageContext::GetStorageArea(int64 id) { } void DOMStorageContext::DeleteSessionStorageNamespace(int64 namespace_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); StorageNamespaceMap::iterator iter = storage_namespace_map_.find(namespace_id); if (iter == storage_namespace_map_.end()) @@ -153,7 +153,7 @@ void DOMStorageContext::DeleteSessionStorageNamespace(int64 namespace_id) { DOMStorageNamespace* DOMStorageContext::GetStorageNamespace( int64 id, bool allocation_allowed) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); StorageNamespaceMap::iterator iter = storage_namespace_map_.find(id); if (iter != storage_namespace_map_.end()) return iter->second; @@ -220,7 +220,7 @@ void DOMStorageContext::DeleteDataModifiedSince(const base::Time& cutoff) { } void DOMStorageContext::DeleteLocalStorageFile(const FilePath& file_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); // Make sure that we don't delete a database that's currently being accessed // by unloading all of the databases temporarily. @@ -232,12 +232,12 @@ void DOMStorageContext::DeleteLocalStorageFile(const FilePath& file_path) { } void DOMStorageContext::DeleteLocalStorageForOrigin(const string16& origin_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DeleteLocalStorageFile(GetLocalStorageFilePath(origin_id)); } void DOMStorageContext::DeleteAllLocalStorageFiles() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); // Make sure that we don't delete a database that's currently being accessed // by unloading all of the databases temporarily. @@ -273,7 +273,7 @@ DOMStorageNamespace* DOMStorageContext::CreateSessionStorage( void DOMStorageContext::RegisterStorageNamespace( DOMStorageNamespace* storage_namespace) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); int64 id = storage_namespace->id(); DCHECK(!GetStorageNamespace(id, false)); storage_namespace_map_[id] = storage_namespace; @@ -282,7 +282,7 @@ void DOMStorageContext::RegisterStorageNamespace( /* static */ void DOMStorageContext::CompleteCloningSessionStorage( DOMStorageContext* context, int64 existing_id, int64 clone_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageNamespace* existing_namespace = context->GetStorageNamespace(existing_id, false); // If nothing exists, then there's nothing to clone. diff --git a/content/browser/in_process_webkit/dom_storage_message_filter.cc b/content/browser/in_process_webkit/dom_storage_message_filter.cc index 1261601..6318c32 100644 --- a/content/browser/in_process_webkit/dom_storage_message_filter.cc +++ b/content/browser/in_process_webkit/dom_storage_message_filter.cc @@ -24,7 +24,7 @@ const GURL* DOMStorageMessageFilter::storage_event_url_ = NULL; DOMStorageMessageFilter:: ScopedStorageEventContext::ScopedStorageEventContext( DOMStorageMessageFilter* dispatcher_message_filter, const GURL* url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DCHECK(!storage_event_message_filter); DCHECK(!storage_event_url_); storage_event_message_filter = dispatcher_message_filter; @@ -35,7 +35,7 @@ ScopedStorageEventContext::ScopedStorageEventContext( DOMStorageMessageFilter:: ScopedStorageEventContext::~ScopedStorageEventContext() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DCHECK(storage_event_message_filter); DCHECK(storage_event_url_); storage_event_message_filter = NULL; @@ -63,7 +63,7 @@ void DOMStorageMessageFilter::OnChannelConnected(int32 peer_pid) { void DOMStorageMessageFilter::DispatchStorageEvent(const NullableString16& key, const NullableString16& old_value, const NullableString16& new_value, const string16& origin, const GURL& url, bool is_local_storage) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DCHECK(is_local_storage); // Only LocalStorage is implemented right now. DCHECK(storage_event_message_filter); DOMStorageMsg_Event_Params params; @@ -107,13 +107,13 @@ void DOMStorageMessageFilter::OverrideThreadForMessage( const IPC::Message& message, BrowserThread::ID* thread) { if (IPC_MESSAGE_CLASS(message) == DOMStorageMsgStart) - *thread = BrowserThread::WEBKIT; + *thread = BrowserThread::WEBKIT_DEPRECATED; } void DOMStorageMessageFilter::OnStorageAreaId(int64 namespace_id, const string16& origin, int64* storage_area_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageNamespace* storage_namespace = Context()->GetStorageNamespace(namespace_id, true); @@ -127,7 +127,7 @@ void DOMStorageMessageFilter::OnStorageAreaId(int64 namespace_id, void DOMStorageMessageFilter::OnLength(int64 storage_area_id, unsigned* length) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *length = 0; @@ -138,7 +138,7 @@ void DOMStorageMessageFilter::OnLength(int64 storage_area_id, void DOMStorageMessageFilter::OnKey(int64 storage_area_id, unsigned index, NullableString16* key) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *key = NullableString16(true); @@ -150,7 +150,7 @@ void DOMStorageMessageFilter::OnKey(int64 storage_area_id, unsigned index, void DOMStorageMessageFilter::OnGetItem(int64 storage_area_id, const string16& key, NullableString16* value) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *value = NullableString16(true); @@ -163,7 +163,7 @@ void DOMStorageMessageFilter::OnSetItem( int64 storage_area_id, const string16& key, const string16& value, const GURL& url, WebKit::WebStorageArea::Result* result, NullableString16* old_value) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *old_value = NullableString16(true); @@ -178,7 +178,7 @@ void DOMStorageMessageFilter::OnSetItem( void DOMStorageMessageFilter::OnRemoveItem( int64 storage_area_id, const string16& key, const GURL& url, NullableString16* old_value) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *old_value = NullableString16(true); @@ -191,7 +191,7 @@ void DOMStorageMessageFilter::OnRemoveItem( void DOMStorageMessageFilter::OnClear(int64 storage_area_id, const GURL& url, bool* something_cleared) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id); if (!storage_area) { *something_cleared = false; diff --git a/content/browser/in_process_webkit/dom_storage_unittest.cc b/content/browser/in_process_webkit/dom_storage_unittest.cc index 6684995..355871e 100644 --- a/content/browser/in_process_webkit/dom_storage_unittest.cc +++ b/content/browser/in_process_webkit/dom_storage_unittest.cc @@ -17,7 +17,7 @@ class DOMStorageTest : public testing::Test { public: DOMStorageTest() : message_loop_(MessageLoop::TYPE_IO), - webkit_thread_(BrowserThread::WEBKIT, &message_loop_) { + webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_) { } protected: diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index 376f4c0..64e23b1 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -171,7 +171,8 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ClearLocalState) { // Make sure we wait until the destructor has run. scoped_refptr<base::ThreadTestHelper> helper( new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED))); ASSERT_TRUE(helper->Run()); ASSERT_TRUE(file_util::DirectoryExists(protected_path)); @@ -218,7 +219,8 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ClearSessionOnlyDatabases) { // Make sure we wait until the destructor has run. scoped_refptr<base::ThreadTestHelper> helper( new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED))); ASSERT_TRUE(helper->Run()); EXPECT_TRUE(file_util::DirectoryExists(normal_path)); @@ -267,7 +269,8 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, SaveSessionState) { // Make sure we wait until the destructor has run. scoped_refptr<base::ThreadTestHelper> helper( new base::ThreadTestHelper( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT))); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED))); ASSERT_TRUE(helper->Run()); // No data was cleared because of SaveSessionState. diff --git a/content/browser/in_process_webkit/indexed_db_context.cc b/content/browser/in_process_webkit/indexed_db_context.cc index 8165724..8afd98c 100644 --- a/content/browser/in_process_webkit/indexed_db_context.cc +++ b/content/browser/in_process_webkit/indexed_db_context.cc @@ -38,7 +38,7 @@ void GetAllOriginsAndPaths( const FilePath& indexeddb_path, std::vector<GURL>* origins, std::vector<FilePath>* file_paths) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (indexeddb_path.empty()) return; file_util::FileEnumerator file_enumerator(indexeddb_path, @@ -62,7 +62,7 @@ void ClearLocalState( const FilePath& indexeddb_path, bool clear_all_databases, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); std::vector<GURL> origins; std::vector<FilePath> file_paths; GetAllOriginsAndPaths(indexeddb_path, &origins, &file_paths); @@ -109,8 +109,11 @@ IndexedDBContext::IndexedDBContext( IndexedDBContext::~IndexedDBContext() { WebKit::WebIDBFactory* factory = idb_factory_.release(); - if (factory) - BrowserThread::DeleteSoon(BrowserThread::WEBKIT, FROM_HERE, factory); + if (factory) { + if (!BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, + FROM_HERE, factory)) + delete factory; + } if (data_path_.empty()) return; @@ -129,13 +132,13 @@ IndexedDBContext::~IndexedDBContext() { // No WEBKIT thread here means we are running in a unit test where no clean // up is needed. BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&ClearLocalState, data_path_, clear_local_state_on_exit_, special_storage_policy_)); } WebIDBFactory* IndexedDBContext::GetIDBFactory() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (!idb_factory_.get()) { // Prime our cache of origins with existing databases so we can // detect when dbs are newly created. @@ -146,7 +149,7 @@ WebIDBFactory* IndexedDBContext::GetIDBFactory() { } void IndexedDBContext::DeleteIndexedDBForOrigin(const GURL& origin_url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (data_path_.empty() || !IsInOriginSet(origin_url)) return; // TODO(michaeln): When asked to delete an origin with open connections, @@ -166,7 +169,7 @@ void IndexedDBContext::DeleteIndexedDBForOrigin(const GURL& origin_url) { } void IndexedDBContext::GetAllOrigins(std::vector<GURL>* origins) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); std::set<GURL>* origins_set = GetOriginSet(); for (std::set<GURL>::const_iterator iter = origins_set->begin(); iter != origins_set->end(); ++iter) { @@ -296,20 +299,20 @@ void IndexedDBContext::GotUsageAndQuota(const GURL& origin_url, return; } BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&IndexedDBContext::GotUpdatedQuota, this, origin_url, usage, quota)); } void IndexedDBContext::GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); space_available_map_[origin_url] = quota - usage; } void IndexedDBContext::QueryAvailableQuota(const GURL& origin_url) { if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (quota_manager_proxy()) BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, 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 fcbb4f7..e138b13 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -52,7 +52,8 @@ namespace { template <class T> void DeleteOnWebKitThread(T* obj) { - if (!BrowserThread::DeleteSoon(BrowserThread::WEBKIT, FROM_HERE, obj)) + if (!BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, + FROM_HERE, obj)) delete obj; } @@ -82,7 +83,7 @@ void IndexedDBDispatcherHost::OnChannelClosing() { BrowserMessageFilter::OnChannelClosing(); bool success = BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&IndexedDBDispatcherHost::ResetDispatcherHosts, this)); if (!success) @@ -94,7 +95,7 @@ void IndexedDBDispatcherHost::ResetDispatcherHosts() { // on the WebKit thread, since there might be incoming messages on that // thread, and we must not reset the dispatcher hosts until after those // messages are processed. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT) || + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED) || CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); database_dispatcher_host_.reset(); @@ -108,7 +109,7 @@ void IndexedDBDispatcherHost::OverrideThreadForMessage( const IPC::Message& message, BrowserThread::ID* thread) { if (IPC_MESSAGE_CLASS(message) == IndexedDBMsgStart) - *thread = BrowserThread::WEBKIT; + *thread = BrowserThread::WEBKIT_DEPRECATED; } bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, @@ -116,7 +117,7 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, if (IPC_MESSAGE_CLASS(message) != IndexedDBMsgStart) return false; - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); bool handled = database_dispatcher_host_->OnMessageReceived(message, message_was_ok) || @@ -197,13 +198,13 @@ int32 IndexedDBDispatcherHost::Add(WebIDBTransaction* idb_transaction, } WebIDBCursor* IndexedDBDispatcherHost::GetCursorFromId(int32 cursor_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); return cursor_dispatcher_host_->map_.Lookup(cursor_id); } void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); FilePath base_path = webkit_context_->data_path(); FilePath indexed_db_path; if (!base_path.empty()) { @@ -219,7 +220,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); GURL origin_url(origin.toString()); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); Context()->GetIDBFactory()->getDatabaseNames( new IndexedDBCallbacks<WebDOMStringList>(this, params.thread_id, @@ -229,7 +230,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( void IndexedDBDispatcherHost::OnIDBFactoryOpen( const IndexedDBHostMsg_FactoryOpen_Params& params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); FilePath base_path = webkit_context_->data_path(); FilePath indexed_db_path; if (!base_path.empty()) { @@ -245,7 +246,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); GURL origin_url(origin.toString()); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); // TODO(dgrogan): Don't let a non-existing database be opened (and therefore // created) if this origin is already over quota. @@ -265,7 +266,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( IndexedDBContext::kIndexedDBDirectory); } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); Context()->GetIDBFactory()->deleteDatabase( params.name, new IndexedDBCallbacks<WebSerializedScriptValue>(this, @@ -287,7 +288,7 @@ void IndexedDBDispatcherHost::TransactionComplete(int32 transaction_id) { template <typename ObjectType> ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( IDMap<ObjectType, IDMapOwnPointer>* map, int32 return_object_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); ObjectType* return_object = map->Lookup(return_object_id); if (!return_object) { content::RecordAction(UserMetricsAction("BadMessageTerminate_IDBMF")); @@ -387,7 +388,7 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnObjectStoreNames( void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params, int32* object_store_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( &map_, params.idb_database_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -411,7 +412,7 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteObjectStore( const string16& name, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( &map_, idb_database_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -429,7 +430,7 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnSetVersion( int32 response_id, const string16& version, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( &map_, idb_database_id); if (!idb_database) @@ -561,7 +562,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor( const IndexedDBHostMsg_IndexOpenCursor_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, params.idb_index_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -582,7 +583,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor( void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenKeyCursor( const IndexedDBHostMsg_IndexOpenCursor_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, params.idb_index_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -603,7 +604,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenKeyCursor( void IndexedDBDispatcherHost::IndexDispatcherHost::OnCount( const IndexedDBHostMsg_IndexCount_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, params.idb_index_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -629,7 +630,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetObject( const IndexedDBKey& key, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, idb_index_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -651,7 +652,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetKey( const IndexedDBKey& key, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, idb_index_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -744,7 +745,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( const IndexedDBKey& key, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -762,7 +763,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( const IndexedDBHostMsg_ObjectStorePut_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, params.idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -791,7 +792,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDelete( const IndexedDBKey& key, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -813,7 +814,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear( int32 response_id, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -831,7 +832,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, int32* index_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, params.idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -872,7 +873,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDeleteIndex( const string16& name, int32 transaction_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( @@ -887,7 +888,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDeleteIndex( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor( const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &parent_->object_store_dispatcher_host_->map_, params.idb_object_store_id); @@ -909,7 +910,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCount( const IndexedDBHostMsg_ObjectStoreCount_Params& params, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &parent_->object_store_dispatcher_host_->map_, params.idb_object_store_id); @@ -1013,7 +1014,7 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnUpdate( int32 response_id, const content::SerializedScriptValue& value, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); if (!idb_cursor) return; @@ -1030,7 +1031,7 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue( int32 response_id, const IndexedDBKey& key, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); if (!idb_cursor) return; @@ -1047,7 +1048,7 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrefetch( int32 response_id, int n, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); if (!idb_cursor) return; @@ -1060,7 +1061,7 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrefetch( void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrefetchReset( int32 cursor_id, int used_prefetches, int unused_prefetches) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); if (!idb_cursor) return; @@ -1073,7 +1074,7 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnDelete( int32 thread_id, int32 response_id, WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); if (!idb_cursor) return; @@ -1165,7 +1166,7 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore( void IndexedDBDispatcherHost:: TransactionDispatcherHost::OnDidCompleteTaskEvents(int transaction_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( &map_, transaction_id); if (!idb_transaction) diff --git a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc index 7580c18..abf62d7 100644 --- a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc +++ b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc @@ -196,7 +196,7 @@ KeyUtilityClientImpl::~KeyUtilityClientImpl() { } void KeyUtilityClientImpl::StartUtilityProcess() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DCHECK(state_ == STATE_UNINITIALIZED); GetRDHAndStartUtilityProcess(); @@ -209,7 +209,7 @@ void KeyUtilityClientImpl::CreateIDBKeysFromSerializedValuesAndKeyPath( const std::vector<content::SerializedScriptValue>& values, const string16& key_path, std::vector<IndexedDBKey>* keys) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (state_ == STATE_SHUTDOWN) { keys->clear(); return; @@ -230,7 +230,7 @@ content::SerializedScriptValue const IndexedDBKey& key, const content::SerializedScriptValue& value, const string16& key_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); if (state_ == STATE_SHUTDOWN) return content::SerializedScriptValue(); diff --git a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc index f9b6742..98a7441 100644 --- a/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc +++ b/content/browser/in_process_webkit/indexed_db_quota_client_unittest.cc @@ -42,7 +42,7 @@ class IndexedDBQuotaClientTest : public testing::Test { usage_(0), weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), message_loop_(MessageLoop::TYPE_IO), - webkit_thread_(BrowserThread::WEBKIT, &message_loop_), + webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_), io_thread_(BrowserThread::IO, &message_loop_) { TestBrowserContext browser_context; idb_context_ = browser_context.GetWebKitContext()->indexed_db_context(); @@ -57,9 +57,10 @@ class IndexedDBQuotaClientTest : public testing::Test { } ~IndexedDBQuotaClientTest() { - // IndexedDBContext needs to be destructed on BrowserThread::WEBKIT, which - // is also a member variable of this class. Cause IndexedDBContext's - // destruction now to ensure that it doesn't outlive BrowserThread::WEBKIT. + // IndexedDBContext needs to be destructed on + // BrowserThread::WEBKIT_DEPRECATED, which is also a member variable of this + // class. Cause IndexedDBContext's destruction now to ensure that it + // doesn't outlive BrowserThread::WEBKIT_DEPRECATED. idb_context_ = NULL; MessageLoop::current()->RunAllPending(); } diff --git a/content/browser/in_process_webkit/webkit_context.cc b/content/browser/in_process_webkit/webkit_context.cc index 6dfa897..f1cb1da 100644 --- a/content/browser/in_process_webkit/webkit_context.cc +++ b/content/browser/in_process_webkit/webkit_context.cc @@ -36,7 +36,7 @@ WebKitContext::~WebKitContext() { clear_local_state_on_exit_); DOMStorageContext* dom_storage_context = dom_storage_context_.release(); if (!BrowserThread::DeleteSoon( - BrowserThread::WEBKIT, FROM_HERE, dom_storage_context)) { + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, dom_storage_context)) { // The WebKit thread wasn't created, and the task got deleted without // freeing the DOMStorageContext, so delete it manually. delete dom_storage_context; @@ -47,9 +47,9 @@ WebKitContext::~WebKitContext() { } void WebKitContext::PurgeMemory() { - if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { + if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)) { BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&WebKitContext::PurgeMemory, this)); return; } @@ -58,9 +58,9 @@ void WebKitContext::PurgeMemory() { } void WebKitContext::DeleteDataModifiedSince(const base::Time& cutoff) { - if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { + if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)) { BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&WebKitContext::DeleteDataModifiedSince, this, cutoff)); return; } @@ -70,9 +70,9 @@ void WebKitContext::DeleteDataModifiedSince(const base::Time& cutoff) { void WebKitContext::DeleteSessionStorageNamespace( int64 session_storage_namespace_id) { - if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { + if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)) { BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&WebKitContext::DeleteSessionStorageNamespace, this, session_storage_namespace_id)); return; @@ -83,9 +83,9 @@ void WebKitContext::DeleteSessionStorageNamespace( } void WebKitContext::SaveSessionState() { - if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { + if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)) { BrowserThread::PostTask( - BrowserThread::WEBKIT, FROM_HERE, + BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, base::Bind(&WebKitContext::SaveSessionState, this)); return; } diff --git a/content/browser/in_process_webkit/webkit_context_unittest.cc b/content/browser/in_process_webkit/webkit_context_unittest.cc index af5a439..f564919 100644 --- a/content/browser/in_process_webkit/webkit_context_unittest.cc +++ b/content/browser/in_process_webkit/webkit_context_unittest.cc @@ -21,7 +21,7 @@ class MockDOMStorageContext : public DOMStorageContext { virtual void PurgeMemory() { EXPECT_FALSE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); ++purge_count_; } @@ -50,7 +50,8 @@ TEST(WebKitContextTest, PurgeMemory) { // Start up a WebKit thread for the WebKitContext to call the // DOMStorageContext on. MessageLoop message_loop(MessageLoop::TYPE_DEFAULT); - BrowserThreadImpl webkit_thread(BrowserThread::WEBKIT, &message_loop); + BrowserThreadImpl webkit_thread(BrowserThread::WEBKIT_DEPRECATED, + &message_loop); { // Create the contexts. diff --git a/content/browser/in_process_webkit/webkit_thread.cc b/content/browser/in_process_webkit/webkit_thread.cc index 8d1dd78..bb1ae40 100644 --- a/content/browser/in_process_webkit/webkit_thread.cc +++ b/content/browser/in_process_webkit/webkit_thread.cc @@ -22,14 +22,15 @@ WebKitThread::~WebKitThread() { // MessageLoop::Current is sometimes NULL and other times valid and there's // no BrowserThread object. Can't check that CurrentlyOn is not IO since // some unit tests set that BrowserThread for other checks. - DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); + DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); } void WebKitThread::Initialize() { DCHECK(!webkit_thread_.get()); if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { - // TODO(jorlow): We need a better story for single process mode. + // TODO(joth): As this cannot work in single process mode use of the + // webkit thread is deprecated; see http://crbug.com/106839. return; } @@ -39,7 +40,7 @@ void WebKitThread::Initialize() { } WebKitThread::InternalWebKitThread::InternalWebKitThread() - : content::BrowserThreadImpl(BrowserThread::WEBKIT) { + : content::BrowserThreadImpl(BrowserThread::WEBKIT_DEPRECATED) { } WebKitThread::InternalWebKitThread::~InternalWebKitThread() { diff --git a/content/browser/in_process_webkit/webkit_thread_unittest.cc b/content/browser/in_process_webkit/webkit_thread_unittest.cc index 07a729f..1d1aa76 100644 --- a/content/browser/in_process_webkit/webkit_thread_unittest.cc +++ b/content/browser/in_process_webkit/webkit_thread_unittest.cc @@ -9,17 +9,17 @@ namespace content { TEST(WebKitThreadTest, DISABLED_ExposedInBrowserThread) { int* null = NULL; // Help the template system out. - EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT, + EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, null)); { WebKitThread thread; - EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT, + EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, null)); thread.Initialize(); - EXPECT_TRUE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT, + EXPECT_TRUE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, null)); } - EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT, + EXPECT_FALSE(BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, null)); } diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h index 743bec6..cf54b4c 100644 --- a/content/public/browser/browser_thread.h +++ b/content/public/browser/browser_thread.h @@ -64,7 +64,9 @@ class CONTENT_EXPORT BrowserThread { // This is the "main" thread for WebKit within the browser process when // NOT in --single-process mode. - WEBKIT, + // Deprecated: Do not design new code to use this thread; see + // http://crbug.com/106839 + WEBKIT_DEPRECATED, // This is the thread that interacts with the file system. FILE, @@ -237,7 +239,7 @@ class CONTENT_EXPORT BrowserThread { struct DeleteOnIOThread : public DeleteOnThread<IO> { }; struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; struct DeleteOnDBThread : public DeleteOnThread<DB> { }; - struct DeleteOnWebKitThread : public DeleteOnThread<WEBKIT> { }; + struct DeleteOnWebKitThread : public DeleteOnThread<WEBKIT_DEPRECATED> { }; private: friend class BrowserThreadImpl; diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index f5c6996..a5ae692 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -248,7 +248,8 @@ void ShellBrowserContext::CreateQuotaManagerAndClients() { BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); webkit_context_ = new WebKitContext( IsOffTheRecord(), GetPath(), NULL, false, quota_manager_->proxy(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); + BrowserThread::GetMessageLoopProxyForThread( + BrowserThread::WEBKIT_DEPRECATED)); appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; BrowserThread::PostTask( diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index 6b14d0f..035b302 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -66,7 +66,7 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { } void ShellBrowserMainParts::PreStopThread(BrowserThread::ID id) { - if (id == BrowserThread::WEBKIT) { + if (id == BrowserThread::WEBKIT_DEPRECATED) { resource_dispatcher_host_.reset(); } } |