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/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "content/common/database_util.h" | 13 #include "content/common/database_util.h" |
14 #include "content/common/fileapi/webblobregistry_impl.h" | 14 #include "content/common/fileapi/webblobregistry_impl.h" |
15 #include "content/common/fileapi/webfilesystem_impl.h" | 15 #include "content/common/fileapi/webfilesystem_impl.h" |
16 #include "content/common/file_utilities_messages.h" | 16 #include "content/common/file_utilities_messages.h" |
17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" | 17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
18 #include "content/common/mime_registry_messages.h" | 18 #include "content/common/mime_registry_messages.h" |
19 #include "content/common/npobject_util.h" | 19 #include "content/common/npobject_util.h" |
20 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
21 #include "content/common/webmessageportchannel_impl.h" | 21 #include "content/common/webmessageportchannel_impl.h" |
| 22 #include "content/public/browser/user_metrics.h" |
22 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
23 #include "content/public/common/gpu_info.h" | 24 #include "content/public/common/gpu_info.h" |
24 #include "content/public/renderer/content_renderer_client.h" | 25 #include "content/public/renderer/content_renderer_client.h" |
25 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 26 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
26 #include "content/renderer/gamepad_shared_memory_reader.h" | 27 #include "content/renderer/gamepad_shared_memory_reader.h" |
27 #include "content/renderer/media/audio_device.h" | 28 #include "content/renderer/media/audio_device.h" |
28 #include "content/renderer/media/audio_hardware.h" | 29 #include "content/renderer/media/audio_hardware.h" |
29 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 30 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
30 #include "content/renderer/render_thread_impl.h" | 31 #include "content/renderer/render_thread_impl.h" |
31 #include "content/renderer/render_view_impl.h" | 32 #include "content/renderer/render_view_impl.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // Even if the sandbox is disabled, there's no reason why the code should | 214 // Even if the sandbox is disabled, there's no reason why the code should |
214 // act any differently...unless we're in single process mode. In which | 215 // act any differently...unless we're in single process mode. In which |
215 // case, we have no other choice. WebKitPlatformSupport.h discourages using | 216 // case, we have no other choice. WebKitPlatformSupport.h discourages using |
216 // this switch unless absolutely necessary, so hopefully we won't end up | 217 // this switch unless absolutely necessary, so hopefully we won't end up |
217 // with too many code paths being different in single-process mode. | 218 // with too many code paths being different in single-process mode. |
218 return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 219 return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); |
219 } | 220 } |
220 | 221 |
221 bool RendererWebKitPlatformSupportImpl::SendSyncMessageFromAnyThread( | 222 bool RendererWebKitPlatformSupportImpl::SendSyncMessageFromAnyThread( |
222 IPC::SyncMessage* msg) { | 223 IPC::SyncMessage* msg) { |
| 224 content::RecordAction(UserMetricsAction("SendSyncIPC_Renderer")); |
| 225 |
223 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 226 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
224 if (render_thread) | 227 if (render_thread) |
225 return render_thread->Send(msg); | 228 return render_thread->Send(msg); |
226 | 229 |
227 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( | 230 scoped_refptr<IPC::SyncMessageFilter> sync_msg_filter( |
228 ChildThread::current()->sync_message_filter()); | 231 ChildThread::current()->sync_message_filter()); |
229 return sync_msg_filter->Send(msg); | 232 return sync_msg_filter->Send(msg); |
230 } | 233 } |
231 | 234 |
232 unsigned long long RendererWebKitPlatformSupportImpl::visitedLinkHash( | 235 unsigned long long RendererWebKitPlatformSupportImpl::visitedLinkHash( |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 DCHECK(render_thread); | 736 DCHECK(render_thread); |
734 if (!render_thread) | 737 if (!render_thread) |
735 return NULL; | 738 return NULL; |
736 return render_thread->CreateMediaStreamCenter(client); | 739 return render_thread->CreateMediaStreamCenter(client); |
737 } | 740 } |
738 | 741 |
739 GpuChannelHostFactory* | 742 GpuChannelHostFactory* |
740 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 743 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
741 return RenderThreadImpl::current(); | 744 return RenderThreadImpl::current(); |
742 } | 745 } |
OLD | NEW |