summaryrefslogtreecommitdiffstats
path: root/content/worker
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-12 19:38:19 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-12 19:38:19 +0000
commit1406f898dc25646d9f242c5ff8d98445953c127b (patch)
treed41dda4efa08b3cf4401f4f96e5ffecdafea2877 /content/worker
parent260966b417e8cfb6a3d954078b553b7bbf680623 (diff)
downloadchromium_src-1406f898dc25646d9f242c5ff8d98445953c127b.zip
chromium_src-1406f898dc25646d9f242c5ff8d98445953c127b.tar.gz
chromium_src-1406f898dc25646d9f242c5ff8d98445953c127b.tar.bz2
Change WebDatabaseObserverImpl to implement public/platform's WebDatabaseObserver
I'm trying to fix DatabaseObserver layering issue in blink and am going to move WebDatabaseObserver from public/web to public/platform. Depends on blink side patches: part 1: https://codereview.chromium.org/64353002/ (landed) part 2: https://codereview.chromium.org/59423003/ BUG=none TEST=layout_tests Review URL: https://codereview.chromium.org/66823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker')
-rw-r--r--content/worker/worker_thread.cc8
-rw-r--r--content/worker/worker_thread.h2
-rw-r--r--content/worker/worker_webkitplatformsupport_impl.cc8
-rw-r--r--content/worker/worker_webkitplatformsupport_impl.h9
4 files changed, 20 insertions, 7 deletions
diff --git a/content/worker/worker_thread.cc b/content/worker/worker_thread.cc
index c62515d..eb6df3b 100644
--- a/content/worker/worker_thread.cc
+++ b/content/worker/worker_thread.cc
@@ -51,9 +51,6 @@ WorkerThread::WorkerThread() {
appcache_dispatcher_.reset(
new AppCacheDispatcher(this, new AppCacheFrontendImpl()));
- web_database_observer_impl_.reset(
- new WebDatabaseObserverImpl(sync_message_filter()));
- blink::WebDatabase::setObserver(web_database_observer_impl_.get());
db_message_filter_ = new DBMessageFilter();
channel()->AddFilter(db_message_filter_.get());
@@ -76,6 +73,11 @@ WorkerThread::~WorkerThread() {
void WorkerThread::Shutdown() {
ChildThread::Shutdown();
+ if (webkit_platform_support_) {
+ webkit_platform_support_->web_database_observer_impl()->
+ WaitForAllDatabasesToClose();
+ }
+
// Shutdown in reverse of the initialization order.
channel()->RemoveFilter(indexed_db_message_filter_.get());
indexed_db_message_filter_ = NULL;
diff --git a/content/worker/worker_thread.h b/content/worker/worker_thread.h
index 7f6b02d..927cd9a 100644
--- a/content/worker/worker_thread.h
+++ b/content/worker/worker_thread.h
@@ -15,7 +15,6 @@ namespace content {
class AppCacheDispatcher;
class DBMessageFilter;
class IndexedDBMessageFilter;
-class WebDatabaseObserverImpl;
class WebSharedWorkerStub;
class WorkerWebKitPlatformSupportImpl;
@@ -46,7 +45,6 @@ class WorkerThread : public ChildThread {
scoped_ptr<WorkerWebKitPlatformSupportImpl> webkit_platform_support_;
scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
- scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_;
scoped_refptr<DBMessageFilter> db_message_filter_;
scoped_refptr<IndexedDBMessageFilter> indexed_db_message_filter_;
diff --git a/content/worker/worker_webkitplatformsupport_impl.cc b/content/worker/worker_webkitplatformsupport_impl.cc
index d60eeaa..07abcbf 100644
--- a/content/worker/worker_webkitplatformsupport_impl.cc
+++ b/content/worker/worker_webkitplatformsupport_impl.cc
@@ -15,6 +15,7 @@
#include "content/child/quota_dispatcher.h"
#include "content/child/quota_message_filter.h"
#include "content/child/thread_safe_sender.h"
+#include "content/child/web_database_observer_impl.h"
#include "content/child/webblobregistry_impl.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/file_utilities_messages.h"
@@ -86,6 +87,8 @@ WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl(
if (sender) {
blob_registry_.reset(new WebBlobRegistryImpl(sender));
web_idb_factory_.reset(new RendererWebIDBFactoryImpl(sender));
+ web_database_observer_impl_.reset(
+ new WebDatabaseObserverImpl(sync_message_filter));
}
}
@@ -213,6 +216,11 @@ blink::WebIDBFactory* WorkerWebKitPlatformSupportImpl::idbFactory() {
return web_idb_factory_.get();
}
+blink::WebPlatformDatabaseObserver*
+WorkerWebKitPlatformSupportImpl::databaseObserver() {
+ return web_database_observer_impl_.get();
+}
+
WebMimeRegistry::SupportsType
WorkerWebKitPlatformSupportImpl::supportsMIMEType(
const WebString&) {
diff --git a/content/worker/worker_webkitplatformsupport_impl.h b/content/worker/worker_webkitplatformsupport_impl.h
index f8965ad..0cf1e5a 100644
--- a/content/worker/worker_webkitplatformsupport_impl.h
+++ b/content/worker/worker_webkitplatformsupport_impl.h
@@ -25,6 +25,7 @@ class WebFileUtilities;
namespace content {
class QuotaMessageFilter;
class ThreadSafeSender;
+class WebDatabaseObserverImpl;
class WebFileSystemImpl;
class WorkerWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl,
@@ -70,10 +71,9 @@ class WorkerWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl,
const blink::WebString& vfs_file_name);
virtual long long databaseGetSpaceAvailableForOrigin(
const blink::WebString& origin_identifier);
-
virtual blink::WebBlobRegistry* blobRegistry();
-
virtual blink::WebIDBFactory* idbFactory();
+ virtual blink::WebPlatformDatabaseObserver* databaseObserver();
// WebMimeRegistry methods:
virtual blink::WebMimeRegistry::SupportsType supportsMIMEType(
@@ -100,6 +100,10 @@ class WorkerWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl,
blink::WebStorageQuotaType,
blink::WebStorageQuotaCallbacks*) OVERRIDE;
+ WebDatabaseObserverImpl* web_database_observer_impl() {
+ return web_database_observer_impl_.get();
+ }
+
private:
class FileUtilities;
@@ -110,6 +114,7 @@ class WorkerWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl,
scoped_refptr<base::MessageLoopProxy> child_thread_loop_;
scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
scoped_refptr<QuotaMessageFilter> quota_message_filter_;
+ scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_;
};
} // namespace content