| 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/renderer/render_thread.h" | 5 #include "content/renderer/render_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/renderer/gpu/gpu_channel_host.h" | 37 #include "content/renderer/gpu/gpu_channel_host.h" |
| 38 #include "content/renderer/gpu/gpu_video_service_host.h" | 38 #include "content/renderer/gpu/gpu_video_service_host.h" |
| 39 #include "content/renderer/indexed_db_dispatcher.h" | 39 #include "content/renderer/indexed_db_dispatcher.h" |
| 40 #include "content/renderer/plugin_channel_host.h" | 40 #include "content/renderer/plugin_channel_host.h" |
| 41 #include "content/renderer/render_process_impl.h" | 41 #include "content/renderer/render_process_impl.h" |
| 42 #include "content/renderer/render_process_observer.h" | 42 #include "content/renderer/render_process_observer.h" |
| 43 #include "content/renderer/render_view.h" | 43 #include "content/renderer/render_view.h" |
| 44 #include "content/renderer/render_view_visitor.h" | 44 #include "content/renderer/render_view_visitor.h" |
| 45 #include "content/renderer/renderer_webidbfactory_impl.h" | 45 #include "content/renderer/renderer_webidbfactory_impl.h" |
| 46 #include "content/renderer/renderer_webkitclient_impl.h" | 46 #include "content/renderer/renderer_webkitclient_impl.h" |
| 47 #include "content/renderer/video_capture_message_filter.h" |
| 48 #include "content/renderer/video_capture_message_filter_creator.h" |
| 47 #include "ipc/ipc_channel_handle.h" | 49 #include "ipc/ipc_channel_handle.h" |
| 48 #include "ipc/ipc_platform_file.h" | 50 #include "ipc/ipc_platform_file.h" |
| 49 #include "net/base/net_errors.h" | 51 #include "net/base/net_errors.h" |
| 50 #include "net/base/net_util.h" | 52 #include "net/base/net_util.h" |
| 51 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" | 53 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" |
| 52 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" | 54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" |
| 53 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 55 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
| 54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 55 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 hidden_widget_count_ = 0; | 162 hidden_widget_count_ = 0; |
| 161 idle_notification_delay_in_s_ = kInitialIdleHandlerDelayS; | 163 idle_notification_delay_in_s_ = kInitialIdleHandlerDelayS; |
| 162 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThread>(this)); | 164 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThread>(this)); |
| 163 | 165 |
| 164 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); | 166 appcache_dispatcher_.reset(new AppCacheDispatcher(this)); |
| 165 indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); | 167 indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); |
| 166 | 168 |
| 167 db_message_filter_ = new DBMessageFilter(); | 169 db_message_filter_ = new DBMessageFilter(); |
| 168 AddFilter(db_message_filter_.get()); | 170 AddFilter(db_message_filter_.get()); |
| 169 | 171 |
| 172 VideoCaptureMessageFilter* video_capture_message_filter = |
| 173 VideoCaptureMessageFilterCreator::SharedFilter(); |
| 174 AddFilter(video_capture_message_filter); |
| 175 |
| 170 content::GetContentClient()->renderer()->RenderThreadStarted(); | 176 content::GetContentClient()->renderer()->RenderThreadStarted(); |
| 171 | 177 |
| 172 TRACE_EVENT_END_ETW("RenderThread::Init", 0, ""); | 178 TRACE_EVENT_END_ETW("RenderThread::Init", 0, ""); |
| 173 } | 179 } |
| 174 | 180 |
| 175 RenderThread::~RenderThread() { | 181 RenderThread::~RenderThread() { |
| 176 FOR_EACH_OBSERVER( | 182 FOR_EACH_OBSERVER( |
| 177 RenderProcessObserver, observers_, OnRenderProcessShutdown()); | 183 RenderProcessObserver, observers_, OnRenderProcessShutdown()); |
| 178 | 184 |
| 179 // Wait for all databases to be closed. | 185 // Wait for all databases to be closed. |
| 180 if (web_database_observer_impl_.get()) | 186 if (web_database_observer_impl_.get()) |
| 181 web_database_observer_impl_->WaitForAllDatabasesToClose(); | 187 web_database_observer_impl_->WaitForAllDatabasesToClose(); |
| 182 | 188 |
| 183 // Shutdown in reverse of the initialization order. | 189 // Shutdown in reverse of the initialization order. |
| 184 RemoveFilter(db_message_filter_.get()); | 190 RemoveFilter(db_message_filter_.get()); |
| 185 db_message_filter_ = NULL; | 191 db_message_filter_ = NULL; |
| 186 | 192 |
| 193 VideoCaptureMessageFilter* video_capture_message_filter = |
| 194 VideoCaptureMessageFilterCreator::SharedFilter(); |
| 195 RemoveFilter(video_capture_message_filter); |
| 196 |
| 187 // Shutdown the file thread if it's running. | 197 // Shutdown the file thread if it's running. |
| 188 if (file_thread_.get()) | 198 if (file_thread_.get()) |
| 189 file_thread_->Stop(); | 199 file_thread_->Stop(); |
| 190 | 200 |
| 191 if (webkit_client_.get()) | 201 if (webkit_client_.get()) |
| 192 WebKit::shutdown(); | 202 WebKit::shutdown(); |
| 193 | 203 |
| 194 lazy_tls.Pointer()->Set(NULL); | 204 lazy_tls.Pointer()->Set(NULL); |
| 195 | 205 |
| 196 // TODO(port) | 206 // TODO(port) |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 685 |
| 676 void RenderThread::RegisterExtension(v8::Extension* extension) { | 686 void RenderThread::RegisterExtension(v8::Extension* extension) { |
| 677 WebScriptController::registerExtension(extension); | 687 WebScriptController::registerExtension(extension); |
| 678 v8_extensions_.insert(extension->name()); | 688 v8_extensions_.insert(extension->name()); |
| 679 } | 689 } |
| 680 | 690 |
| 681 bool RenderThread::IsRegisteredExtension( | 691 bool RenderThread::IsRegisteredExtension( |
| 682 const std::string& v8_extension_name) const { | 692 const std::string& v8_extension_name) const { |
| 683 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); | 693 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); |
| 684 } | 694 } |
| OLD | NEW |