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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), | 240 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), |
241 main_thread_(renderer_scheduler->CreateMainThread()), | 241 main_thread_(renderer_scheduler->CreateMainThread()), |
242 clipboard_delegate_(new RendererClipboardDelegate), | 242 clipboard_delegate_(new RendererClipboardDelegate), |
243 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), | 243 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), |
244 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), | 244 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), |
245 sudden_termination_disables_(0), | 245 sudden_termination_disables_(0), |
246 plugin_refresh_allowed_(true), | 246 plugin_refresh_allowed_(true), |
247 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), | 247 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), |
248 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), | 248 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), |
249 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), | 249 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), |
250 renderer_scheduler_(renderer_scheduler) { | 250 renderer_scheduler_(renderer_scheduler), |
| 251 web_blame_context_(new WebBlameContextImpl( |
| 252 RenderThreadImpl::current()->blame_context())) { |
251 #if !defined(OS_ANDROID) && !defined(OS_WIN) | 253 #if !defined(OS_ANDROID) && !defined(OS_WIN) |
252 if (g_sandbox_enabled && sandboxEnabled()) { | 254 if (g_sandbox_enabled && sandboxEnabled()) { |
253 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); | 255 sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); |
254 } else { | 256 } else { |
255 DVLOG(1) << "Disabling sandbox support for testing."; | 257 DVLOG(1) << "Disabling sandbox support for testing."; |
256 } | 258 } |
257 #endif | 259 #endif |
258 | 260 |
259 // ChildThread may not exist in some tests. | 261 // ChildThread may not exist in some tests. |
260 if (ChildThreadImpl::current()) { | 262 if (ChildThreadImpl::current()) { |
(...skipping 30 matching lines...) Expand all Loading... |
291 child_thread ? child_thread->resource_dispatcher() : NULL, | 293 child_thread ? child_thread->resource_dispatcher() : NULL, |
292 make_scoped_ptr(currentThread()->taskRunner()->clone())); | 294 make_scoped_ptr(currentThread()->taskRunner()->clone())); |
293 } | 295 } |
294 | 296 |
295 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { | 297 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { |
296 if (main_thread_->isCurrentThread()) | 298 if (main_thread_->isCurrentThread()) |
297 return main_thread_.get(); | 299 return main_thread_.get(); |
298 return BlinkPlatformImpl::currentThread(); | 300 return BlinkPlatformImpl::currentThread(); |
299 } | 301 } |
300 | 302 |
| 303 blink::WebBlameContext* RendererBlinkPlatformImpl::threadBlameContext() { |
| 304 if (!main_thread_->isCurrentThread()) |
| 305 return nullptr; |
| 306 return web_blame_context_.get(); |
| 307 } |
| 308 |
301 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() { | 309 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() { |
302 blink::WebClipboard* clipboard = | 310 blink::WebClipboard* clipboard = |
303 GetContentClient()->renderer()->OverrideWebClipboard(); | 311 GetContentClient()->renderer()->OverrideWebClipboard(); |
304 if (clipboard) | 312 if (clipboard) |
305 return clipboard; | 313 return clipboard; |
306 return clipboard_.get(); | 314 return clipboard_.get(); |
307 } | 315 } |
308 | 316 |
309 blink::WebMimeRegistry* RendererBlinkPlatformImpl::mimeRegistry() { | 317 blink::WebMimeRegistry* RendererBlinkPlatformImpl::mimeRegistry() { |
310 return mime_registry_.get(); | 318 return mime_registry_.get(); |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 } | 1268 } |
1261 | 1269 |
1262 //------------------------------------------------------------------------------ | 1270 //------------------------------------------------------------------------------ |
1263 | 1271 |
1264 blink::WebTrialTokenValidator* | 1272 blink::WebTrialTokenValidator* |
1265 RendererBlinkPlatformImpl::trialTokenValidator() { | 1273 RendererBlinkPlatformImpl::trialTokenValidator() { |
1266 return &trial_token_validator_; | 1274 return &trial_token_validator_; |
1267 } | 1275 } |
1268 | 1276 |
1269 } // namespace content | 1277 } // namespace content |
OLD | NEW |