OLD | NEW |
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/common/web_database_observer_impl.h" | 12 #include "content/common/web_database_observer_impl.h" |
13 #include "content/common/worker_messages.h" | 13 #include "content/common/worker_messages.h" |
14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 #include "content/worker/websharedworker_stub.h" | 15 #include "content/worker/websharedworker_stub.h" |
16 #include "content/worker/worker_webkitplatformsupport_impl.h" | 16 #include "content/worker/worker_webkitplatformsupport_impl.h" |
17 #include "ipc/ipc_sync_channel.h" | 17 #include "ipc/ipc_sync_channel.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
22 #include "webkit/glue/webkit_glue.h" | 22 #include "webkit/glue/webkit_glue.h" |
23 | 23 |
24 using WebKit::WebRuntimeFeatures; | 24 using WebKit::WebRuntimeFeatures; |
25 | 25 |
26 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls( | 26 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = |
27 base::LINKER_INITIALIZED); | 27 LAZY_INSTANCE_INITIALIZER; |
28 | 28 |
29 | 29 |
30 WorkerThread::WorkerThread() { | 30 WorkerThread::WorkerThread() { |
31 lazy_tls.Pointer()->Set(this); | 31 lazy_tls.Pointer()->Set(this); |
32 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); | 32 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); |
33 WebKit::initialize(webkit_platform_support_.get()); | 33 WebKit::initialize(webkit_platform_support_.get()); |
34 | 34 |
35 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); | 35 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); |
36 | 36 |
37 web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this)); | 37 web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this)); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { | 112 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { |
113 worker_stubs_.erase(stub); | 113 worker_stubs_.erase(stub); |
114 } | 114 } |
115 | 115 |
116 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { | 116 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { |
117 worker_stubs_.insert(stub); | 117 worker_stubs_.insert(stub); |
118 } | 118 } |
OLD | NEW |