| 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/common/appcache/appcache_dispatcher.h" | 10 #include "content/common/appcache/appcache_dispatcher.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = | 29 static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = |
| 30 LAZY_INSTANCE_INITIALIZER; | 30 LAZY_INSTANCE_INITIALIZER; |
| 31 | 31 |
| 32 WorkerThread::WorkerThread() { | 32 WorkerThread::WorkerThread() { |
| 33 lazy_tls.Pointer()->Set(this); | 33 lazy_tls.Pointer()->Set(this); |
| 34 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); | 34 webkit_platform_support_.reset(new WorkerWebKitPlatformSupportImpl); |
| 35 WebKit::initialize(webkit_platform_support_.get()); | 35 WebKit::initialize(webkit_platform_support_.get()); |
| 36 | 36 |
| 37 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); | 37 appcache_dispatcher_.reset(new content::AppCacheDispatcher(this)); |
| 38 | 38 |
| 39 web_database_observer_impl_.reset( | 39 web_database_observer_impl_.reset( |
| 40 new WebDatabaseObserverImpl(sync_message_filter())); | 40 new WebDatabaseObserverImpl(sync_message_filter())); |
| 41 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); | 41 WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); |
| 42 db_message_filter_ = new DBMessageFilter(); | 42 db_message_filter_ = new DBMessageFilter(); |
| 43 channel()->AddFilter(db_message_filter_.get()); | 43 channel()->AddFilter(db_message_filter_.get()); |
| 44 | 44 |
| 45 indexed_db_message_filter_ = new IndexedDBMessageFilter; | 45 indexed_db_message_filter_ = new content::IndexedDBMessageFilter; |
| 46 channel()->AddFilter(indexed_db_message_filter_.get()); | 46 channel()->AddFilter(indexed_db_message_filter_.get()); |
| 47 | 47 |
| 48 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 48 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 49 | 49 |
| 50 webkit_glue::EnableWebCoreLogChannels( | 50 webkit_glue::EnableWebCoreLogChannels( |
| 51 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 51 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 52 | 52 |
| 53 WebKit::WebRuntimeFeatures::enableDatabase( | 53 WebKit::WebRuntimeFeatures::enableDatabase( |
| 54 !command_line.HasSwitch(switches::kDisableDatabases)); | 54 !command_line.HasSwitch(switches::kDisableDatabases)); |
| 55 | 55 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { | 123 void WorkerThread::RemoveWorkerStub(WebSharedWorkerStub* stub) { |
| 124 worker_stubs_.erase(stub); | 124 worker_stubs_.erase(stub); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { | 127 void WorkerThread::AddWorkerStub(WebSharedWorkerStub* stub) { |
| 128 worker_stubs_.insert(stub); | 128 worker_stubs_.insert(stub); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace content | 131 } // namespace content |
| OLD | NEW |