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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "content/renderer/plugin_channel_host.h" | 67 #include "content/renderer/plugin_channel_host.h" |
68 #include "content/renderer/render_process_impl.h" | 68 #include "content/renderer/render_process_impl.h" |
69 #include "content/renderer/render_view_impl.h" | 69 #include "content/renderer/render_view_impl.h" |
70 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 70 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
71 #include "grit/content_resources.h" | 71 #include "grit/content_resources.h" |
72 #include "ipc/ipc_channel_handle.h" | 72 #include "ipc/ipc_channel_handle.h" |
73 #include "ipc/ipc_platform_file.h" | 73 #include "ipc/ipc_platform_file.h" |
74 #include "media/base/media.h" | 74 #include "media/base/media.h" |
75 #include "net/base/net_errors.h" | 75 #include "net/base/net_errors.h" |
76 #include "net/base/net_util.h" | 76 #include "net/base/net_util.h" |
| 77 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositor.h" |
| 78 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" | 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" |
78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | |
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi
er.h" | 84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi
er.h" |
84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 86 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
86 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
89 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | |
90 #include "ui/base/layout.h" | 90 #include "ui/base/layout.h" |
91 #include "ui/base/ui_base_switches.h" | 91 #include "ui/base/ui_base_switches.h" |
92 #include "v8/include/v8.h" | 92 #include "v8/include/v8.h" |
93 #include "webkit/glue/webkit_glue.h" | 93 #include "webkit/glue/webkit_glue.h" |
94 | 94 |
95 // TODO(port) | 95 // TODO(port) |
96 #if !defined(OS_WIN) | 96 #if !defined(OS_WIN) |
97 #include "base/memory/scoped_handle.h" | 97 #include "base/memory/scoped_handle.h" |
98 #include "content/common/np_channel_base.h" | 98 #include "content/common/np_channel_base.h" |
99 #endif | 99 #endif |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 AddFilter(devtools_agent_message_filter_.get()); | 248 AddFilter(devtools_agent_message_filter_.get()); |
249 | 249 |
250 AddFilter(new IndexedDBMessageFilter); | 250 AddFilter(new IndexedDBMessageFilter); |
251 | 251 |
252 content::GetContentClient()->renderer()->RenderThreadStarted(); | 252 content::GetContentClient()->renderer()->RenderThreadStarted(); |
253 | 253 |
254 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 254 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
255 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) | 255 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) |
256 RegisterExtension(content::GpuBenchmarkingExtension::Get()); | 256 RegisterExtension(content::GpuBenchmarkingExtension::Get()); |
257 | 257 |
258 #if defined(WEBCOMPOSITOR_OWNS_SETTINGS) | |
259 WebKit::WebCompositor::setAcceleratedAnimationEnabled( | 258 WebKit::WebCompositor::setAcceleratedAnimationEnabled( |
260 !command_line.HasSwitch(switches::kDisableThreadedAnimation)); | 259 !command_line.HasSwitch(switches::kDisableThreadedAnimation)); |
261 WebKit::WebCompositor::setPerTilePaintingEnabled( | 260 WebKit::WebCompositor::setPerTilePaintingEnabled( |
262 command_line.HasSwitch(switches::kEnablePerTilePainting)); | 261 command_line.HasSwitch(switches::kEnablePerTilePainting)); |
263 WebKit::WebCompositor::setPartialSwapEnabled( | 262 WebKit::WebCompositor::setPartialSwapEnabled( |
264 command_line.HasSwitch(switches::kEnablePartialSwap)); | 263 command_line.HasSwitch(switches::kEnablePartialSwap)); |
265 #endif | |
266 | 264 |
267 // Note that under Linux, the media library will normally already have | 265 // Note that under Linux, the media library will normally already have |
268 // been initialized by the Zygote before this instance became a Renderer. | 266 // been initialized by the Zygote before this instance became a Renderer. |
269 FilePath media_path; | 267 FilePath media_path; |
270 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); | 268 PathService::Get(content::DIR_MEDIA_LIBS, &media_path); |
271 if (!media_path.empty()) | 269 if (!media_path.empty()) |
272 media::InitializeMediaLibrary(media_path); | 270 media::InitializeMediaLibrary(media_path); |
273 | 271 |
274 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); | 272 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); |
275 } | 273 } |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 | 1038 |
1041 scoped_refptr<base::MessageLoopProxy> | 1039 scoped_refptr<base::MessageLoopProxy> |
1042 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1040 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1043 DCHECK(message_loop() == MessageLoop::current()); | 1041 DCHECK(message_loop() == MessageLoop::current()); |
1044 if (!file_thread_.get()) { | 1042 if (!file_thread_.get()) { |
1045 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1043 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1046 file_thread_->Start(); | 1044 file_thread_->Start(); |
1047 } | 1045 } |
1048 return file_thread_->message_loop_proxy(); | 1046 return file_thread_->message_loop_proxy(); |
1049 } | 1047 } |
OLD | NEW |