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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.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 10 matching lines...) Expand all Loading... |
21 #include "base/threading/thread_local.h" | 21 #include "base/threading/thread_local.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "base/win/scoped_com_initializer.h" | 23 #include "base/win/scoped_com_initializer.h" |
24 #include "content/common/appcache/appcache_dispatcher.h" | 24 #include "content/common/appcache/appcache_dispatcher.h" |
25 #include "content/common/child_process_messages.h" | 25 #include "content/common/child_process_messages.h" |
26 #include "content/common/database_messages.h" | 26 #include "content/common/database_messages.h" |
27 #include "content/common/db_message_filter.h" | 27 #include "content/common/db_message_filter.h" |
28 #include "content/common/dom_storage_messages.h" | 28 #include "content/common/dom_storage_messages.h" |
29 #include "content/common/gpu/client/gpu_channel_host.h" | 29 #include "content/common/gpu/client/gpu_channel_host.h" |
30 #include "content/common/gpu/gpu_messages.h" | 30 #include "content/common/gpu/gpu_messages.h" |
| 31 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
| 32 #include "content/common/indexed_db/indexed_db_message_filter.h" |
| 33 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
31 #include "content/common/npobject_util.h" | 34 #include "content/common/npobject_util.h" |
32 #include "content/common/plugin_messages.h" | 35 #include "content/common/plugin_messages.h" |
33 #include "content/common/resource_dispatcher.h" | 36 #include "content/common/resource_dispatcher.h" |
34 #include "content/common/resource_messages.h" | 37 #include "content/common/resource_messages.h" |
35 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
36 #include "content/common/web_database_observer_impl.h" | 39 #include "content/common/web_database_observer_impl.h" |
37 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/renderer_preferences.h" | 41 #include "content/public/common/renderer_preferences.h" |
39 #include "content/public/renderer/content_renderer_client.h" | 42 #include "content/public/renderer/content_renderer_client.h" |
40 #include "content/public/renderer/render_process_observer.h" | 43 #include "content/public/renderer/render_process_observer.h" |
41 #include "content/public/renderer/render_view_visitor.h" | 44 #include "content/public/renderer/render_view_visitor.h" |
42 #include "content/renderer/devtools_agent_filter.h" | 45 #include "content/renderer/devtools_agent_filter.h" |
43 #include "content/renderer/gpu/compositor_thread.h" | 46 #include "content/renderer/gpu/compositor_thread.h" |
44 #include "content/renderer/indexed_db/indexed_db_dispatcher.h" | |
45 #include "content/renderer/indexed_db/indexed_db_message_filter.h" | |
46 #include "content/renderer/indexed_db/renderer_webidbfactory_impl.h" | |
47 #include "content/renderer/media/audio_input_message_filter.h" | 47 #include "content/renderer/media/audio_input_message_filter.h" |
48 #include "content/renderer/media/audio_message_filter.h" | 48 #include "content/renderer/media/audio_message_filter.h" |
49 #include "content/renderer/media/video_capture_impl_manager.h" | 49 #include "content/renderer/media/video_capture_impl_manager.h" |
50 #include "content/renderer/media/video_capture_message_filter.h" | 50 #include "content/renderer/media/video_capture_message_filter.h" |
51 #include "content/renderer/plugin_channel_host.h" | 51 #include "content/renderer/plugin_channel_host.h" |
52 #include "content/renderer/render_process_impl.h" | 52 #include "content/renderer/render_process_impl.h" |
53 #include "content/renderer/render_view_impl.h" | 53 #include "content/renderer/render_view_impl.h" |
54 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 54 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
55 #include "grit/content_resources.h" | 55 #include "grit/content_resources.h" |
56 #include "ipc/ipc_channel_handle.h" | 56 #include "ipc/ipc_channel_handle.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 676 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
677 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 677 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
678 } | 678 } |
679 | 679 |
680 void RenderThreadImpl::ReleaseCachedFonts() { | 680 void RenderThreadImpl::ReleaseCachedFonts() { |
681 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); | 681 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); |
682 } | 682 } |
683 | 683 |
684 #endif // OS_WIN | 684 #endif // OS_WIN |
685 | 685 |
| 686 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { |
| 687 if (!web_frame) |
| 688 return false; // We must be shutting down. |
| 689 |
| 690 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
| 691 if (!render_view) |
| 692 return false; // We must be shutting down. |
| 693 |
| 694 return true; |
| 695 } |
| 696 |
686 bool RenderThreadImpl::IsMainThread() { | 697 bool RenderThreadImpl::IsMainThread() { |
687 return !!current(); | 698 return !!current(); |
688 } | 699 } |
689 | 700 |
690 bool RenderThreadImpl::IsIOThread() { | 701 bool RenderThreadImpl::IsIOThread() { |
691 return MessageLoop::current() == ChildProcess::current()->io_message_loop(); | 702 return MessageLoop::current() == ChildProcess::current()->io_message_loop(); |
692 } | 703 } |
693 | 704 |
694 MessageLoop* RenderThreadImpl::GetMainLoop() { | 705 MessageLoop* RenderThreadImpl::GetMainLoop() { |
695 return message_loop(); | 706 return message_loop(); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 921 |
911 scoped_refptr<base::MessageLoopProxy> | 922 scoped_refptr<base::MessageLoopProxy> |
912 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 923 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
913 DCHECK(message_loop() == MessageLoop::current()); | 924 DCHECK(message_loop() == MessageLoop::current()); |
914 if (!file_thread_.get()) { | 925 if (!file_thread_.get()) { |
915 file_thread_.reset(new base::Thread("Renderer::FILE")); | 926 file_thread_.reset(new base::Thread("Renderer::FILE")); |
916 file_thread_->Start(); | 927 file_thread_->Start(); |
917 } | 928 } |
918 return file_thread_->message_loop_proxy(); | 929 return file_thread_->message_loop_proxy(); |
919 } | 930 } |
OLD | NEW |