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

Side by Side Diff: content/worker/worker_thread.cc

Issue 9375024: Get IPC working for Indexed DB in shared workers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add webframe check Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/worker/worker_thread.h" 5 #include "content/worker/worker_thread.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/thread_local.h" 9 #include "base/threading/thread_local.h"
10 #include "content/common/appcache/appcache_dispatcher.h" 10 #include "content/common/appcache/appcache_dispatcher.h"
11 #include "content/common/db_message_filter.h" 11 #include "content/common/db_message_filter.h"
12 #include "content/renderer/indexed_db/indexed_db_message_filter.h"
jsbell 2012/02/09 23:23:56 I assume this is moving, so order will become corr
12 #include "content/common/web_database_observer_impl.h" 13 #include "content/common/web_database_observer_impl.h"
13 #include "content/common/worker_messages.h" 14 #include "content/common/worker_messages.h"
14 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
15 #include "content/worker/websharedworker_stub.h" 16 #include "content/worker/websharedworker_stub.h"
16 #include "content/worker/worker_webkitplatformsupport_impl.h" 17 #include "content/worker/worker_webkitplatformsupport_impl.h"
17 #include "ipc/ipc_sync_channel.h" 18 #include "ipc/ipc_sync_channel.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
(...skipping 10 matching lines...) Expand all
32 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); 33 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl);
33 WebKit::initialize(webkit_platform_support_.get()); 34 WebKit::initialize(webkit_platform_support_.get());
34 35
35 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); 36 appcache_dispatcher_.reset(new AppCacheDispatcher(this));
36 37
37 web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this)); 38 web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this));
38 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); 39 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get());
39 db_message_filter_ = new DBMessageFilter(); 40 db_message_filter_ = new DBMessageFilter();
40 channel()->AddFilter(db_message_filter_.get()); 41 channel()->AddFilter(db_message_filter_.get());
41 42
43 indexed_db_message_filter_ = new IndexedDBMessageFilter;
44 channel()->AddFilter(indexed_db_message_filter_.get());
45
42 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 46 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
43 47
44 webkit_glue::EnableWebCoreLogChannels( 48 webkit_glue::EnableWebCoreLogChannels(
45 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); 49 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
46 50
47 WebKit::WebRuntimeFeatures::enableDatabase( 51 WebKit::WebRuntimeFeatures::enableDatabase(
48 !command_line.HasSwitch(switches::kDisableDatabases)); 52 !command_line.HasSwitch(switches::kDisableDatabases));
49 53
50 WebKit::WebRuntimeFeatures::enableApplicationCache( 54 WebKit::WebRuntimeFeatures::enableApplicationCache(
51 !command_line.HasSwitch(switches::kDisableApplicationCache)); 55 !command_line.HasSwitch(switches::kDisableApplicationCache));
52 56
53 #if defined(OS_WIN) 57 #if defined(OS_WIN)
54 // We don't yet support notifications on non-Windows, so hide it from pages. 58 // We don't yet support notifications on non-Windows, so hide it from pages.
55 WebRuntimeFeatures::enableNotifications( 59 WebRuntimeFeatures::enableNotifications(
56 !command_line.HasSwitch(switches::kDisableDesktopNotifications)); 60 !command_line.HasSwitch(switches::kDisableDesktopNotifications));
57 #endif 61 #endif
58 62
59 WebRuntimeFeatures::enableSockets( 63 WebRuntimeFeatures::enableSockets(
60 !command_line.HasSwitch(switches::kDisableWebSockets)); 64 !command_line.HasSwitch(switches::kDisableWebSockets));
61 65
62 WebRuntimeFeatures::enableFileSystem( 66 WebRuntimeFeatures::enableFileSystem(
63 !command_line.HasSwitch(switches::kDisableFileSystem)); 67 !command_line.HasSwitch(switches::kDisableFileSystem));
64 } 68 }
65 69
66 WorkerThread::~WorkerThread() { 70 WorkerThread::~WorkerThread() {
67 // Shutdown in reverse of the initialization order. 71 // Shutdown in reverse of the initialization order.
72 channel()->RemoveFilter(indexed_db_message_filter_.get());
73 indexed_db_message_filter_ = NULL;
74
68 channel()->RemoveFilter(db_message_filter_.get()); 75 channel()->RemoveFilter(db_message_filter_.get());
69 db_message_filter_ = NULL; 76 db_message_filter_ = NULL;
70 77
71 WebKit::shutdown(); 78 WebKit::shutdown();
72 lazy_tls.Pointer()->Set(NULL); 79 lazy_tls.Pointer()->Set(NULL);
73 } 80 }
74 81
75 WorkerThread* WorkerThread::current() { 82 WorkerThread* WorkerThread::current() {
76 return lazy_tls.Pointer()->Get(); 83 return lazy_tls.Pointer()->Get();
77 } 84 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 116 }
110 } 117 }
111 118
112 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { 119 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) {
113 worker_stubs_.erase(stub); 120 worker_stubs_.erase(stub);
114 } 121 }
115 122
116 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { 123 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) {
117 worker_stubs_.insert(stub); 124 worker_stubs_.insert(stub);
118 } 125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698