| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/appcache_dispatcher.h" | 10 #include "content/child/appcache_dispatcher.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 using WebKit::WebRuntimeFeatures; | 27 using WebKit::WebRuntimeFeatures; |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = | 31 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = |
| 32 LAZY_INSTANCE_INITIALIZER; | 32 LAZY_INSTANCE_INITIALIZER; |
| 33 | 33 |
| 34 WorkerThread::WorkerThread() { | 34 WorkerThread::WorkerThread() { |
| 35 lazy_tls.Pointer()->Set(this); | 35 lazy_tls.Pointer()->Set(this); |
| 36 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl( | 36 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl( |
| 37 thread_safe_sender(), | 37 thread_safe_sender(), sync_message_filter())); |
| 38 sync_message_filter(), | |
| 39 quota_message_filter())); | |
| 40 WebKit::initialize(webkit_platform_support_.get()); | 38 WebKit::initialize(webkit_platform_support_.get()); |
| 41 | 39 |
| 42 appcache_dispatcher_.reset( | 40 appcache_dispatcher_.reset( |
| 43 new AppCacheDispatcher(this, new appcache::AppCacheFrontendImpl())); | 41 new AppCacheDispatcher(this, new appcache::AppCacheFrontendImpl())); |
| 44 | 42 |
| 45 web_database_observer_impl_.reset( | 43 web_database_observer_impl_.reset( |
| 46 new WebDatabaseObserverImpl(sync_message_filter())); | 44 new WebDatabaseObserverImpl(sync_message_filter())); |
| 47 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); | 45 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); |
| 48 db_message_filter_ = new DBMessageFilter(); | 46 db_message_filter_ = new DBMessageFilter(); |
| 49 channel()->AddFilter(db_message_filter_.get()); | 47 channel()->AddFilter(db_message_filter_.get()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 110 |
| 113 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { | 111 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { |
| 114 worker_stubs_.erase(stub); | 112 worker_stubs_.erase(stub); |
| 115 } | 113 } |
| 116 | 114 |
| 117 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { | 115 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { |
| 118 worker_stubs_.insert(stub); | 116 worker_stubs_.insert(stub); |
| 119 } | 117 } |
| 120 | 118 |
| 121 } // namespace content | 119 } // namespace content |
| OLD | NEW |