| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "content/common/view_messages.h" | 56 #include "content/common/view_messages.h" |
| 57 #include "content/common/worker_messages.h" | 57 #include "content/common/worker_messages.h" |
| 58 #include "content/public/common/content_constants.h" | 58 #include "content/public/common/content_constants.h" |
| 59 #include "content/public/common/content_paths.h" | 59 #include "content/public/common/content_paths.h" |
| 60 #include "content/public/common/content_switches.h" | 60 #include "content/public/common/content_switches.h" |
| 61 #include "content/public/common/renderer_preferences.h" | 61 #include "content/public/common/renderer_preferences.h" |
| 62 #include "content/public/common/url_constants.h" | 62 #include "content/public/common/url_constants.h" |
| 63 #include "content/public/renderer/content_renderer_client.h" | 63 #include "content/public/renderer/content_renderer_client.h" |
| 64 #include "content/public/renderer/render_process_observer.h" | 64 #include "content/public/renderer/render_process_observer.h" |
| 65 #include "content/public/renderer/render_view_visitor.h" | 65 #include "content/public/renderer/render_view_visitor.h" |
| 66 #include "content/renderer/compositor_bindings/web_external_bitmap_impl.h" |
| 67 #include "content/renderer/compositor_bindings/web_layer_impl.h" |
| 66 #include "content/renderer/devtools/devtools_agent_filter.h" | 68 #include "content/renderer/devtools/devtools_agent_filter.h" |
| 67 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 69 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
| 68 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 70 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
| 69 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 71 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 70 #include "content/renderer/gamepad_shared_memory_reader.h" | 72 #include "content/renderer/gamepad_shared_memory_reader.h" |
| 71 #include "content/renderer/gpu/compositor_output_surface.h" | 73 #include "content/renderer/gpu/compositor_output_surface.h" |
| 72 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 74 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
| 73 #include "content/renderer/input/input_event_filter.h" | 75 #include "content/renderer/input/input_event_filter.h" |
| 74 #include "content/renderer/input/input_handler_manager.h" | 76 #include "content/renderer/input/input_handler_manager.h" |
| 75 #include "content/renderer/media/audio_input_message_filter.h" | 77 #include "content/renderer/media/audio_input_message_filter.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 116 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
| 115 #include "third_party/WebKit/public/web/WebPopupMenu.h" | 117 #include "third_party/WebKit/public/web/WebPopupMenu.h" |
| 116 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 118 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 117 #include "third_party/WebKit/public/web/WebScriptController.h" | 119 #include "third_party/WebKit/public/web/WebScriptController.h" |
| 118 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 120 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 119 #include "third_party/WebKit/public/web/WebView.h" | 121 #include "third_party/WebKit/public/web/WebView.h" |
| 120 #include "third_party/skia/include/core/SkGraphics.h" | 122 #include "third_party/skia/include/core/SkGraphics.h" |
| 121 #include "ui/base/layout.h" | 123 #include "ui/base/layout.h" |
| 122 #include "ui/base/ui_base_switches.h" | 124 #include "ui/base/ui_base_switches.h" |
| 123 #include "v8/include/v8.h" | 125 #include "v8/include/v8.h" |
| 124 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" | |
| 125 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | |
| 126 | 126 |
| 127 #if defined(OS_ANDROID) | 127 #if defined(OS_ANDROID) |
| 128 #include <cpu-features.h> | 128 #include <cpu-features.h> |
| 129 #include "content/renderer/android/synchronous_compositor_factory.h" | 129 #include "content/renderer/android/synchronous_compositor_factory.h" |
| 130 #include "content/renderer/media/android/renderer_demuxer_android.h" | 130 #include "content/renderer/media/android/renderer_demuxer_android.h" |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 #if defined(OS_MACOSX) | 133 #if defined(OS_MACOSX) |
| 134 #include "content/renderer/webscrollbarbehavior_impl_mac.h" | 134 #include "content/renderer/webscrollbarbehavior_impl_mac.h" |
| 135 #endif | 135 #endif |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 GetContentClient()->renderer()->RenderThreadStarted(); | 404 GetContentClient()->renderer()->RenderThreadStarted(); |
| 405 | 405 |
| 406 InitSkiaEventTracer(); | 406 InitSkiaEventTracer(); |
| 407 | 407 |
| 408 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 408 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 409 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 409 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
| 410 RegisterExtension(GpuBenchmarkingExtension::Get()); | 410 RegisterExtension(GpuBenchmarkingExtension::Get()); |
| 411 | 411 |
| 412 is_impl_side_painting_enabled_ = | 412 is_impl_side_painting_enabled_ = |
| 413 command_line.HasSwitch(switches::kEnableImplSidePainting); | 413 command_line.HasSwitch(switches::kEnableImplSidePainting); |
| 414 webkit::WebLayerImpl::SetImplSidePaintingEnabled( | 414 WebLayerImpl::SetImplSidePaintingEnabled(is_impl_side_painting_enabled_); |
| 415 is_impl_side_painting_enabled_); | |
| 416 | 415 |
| 417 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && | 416 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && |
| 418 !command_line.HasSwitch(switches::kDisableZeroCopy); | 417 !command_line.HasSwitch(switches::kDisableZeroCopy); |
| 419 | 418 |
| 420 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); | 419 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); |
| 421 | 420 |
| 422 if (command_line.HasSwitch(switches::kDisableLCDText)) { | 421 if (command_line.HasSwitch(switches::kDisableLCDText)) { |
| 423 is_lcd_text_enabled_ = false; | 422 is_lcd_text_enabled_ = false; |
| 424 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { | 423 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { |
| 425 is_lcd_text_enabled_ = true; | 424 is_lcd_text_enabled_ = true; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 } | 798 } |
| 800 | 799 |
| 801 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); | 800 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); |
| 802 | 801 |
| 803 devtools_agent_message_filter_ = new DevToolsAgentFilter(); | 802 devtools_agent_message_filter_ = new DevToolsAgentFilter(); |
| 804 AddFilter(devtools_agent_message_filter_.get()); | 803 AddFilter(devtools_agent_message_filter_.get()); |
| 805 | 804 |
| 806 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) | 805 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
| 807 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 806 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 808 | 807 |
| 809 webkit::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); | 808 SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); |
| 810 | 809 |
| 811 // Limit use of the scaled image cache to when deferred image decoding is | 810 // Limit use of the scaled image cache to when deferred image decoding is |
| 812 // enabled. | 811 // enabled. |
| 813 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && | 812 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && |
| 814 !is_impl_side_painting_enabled_) | 813 !is_impl_side_painting_enabled_) |
| 815 SkGraphics::SetImageCacheByteLimit(0u); | 814 SkGraphics::SetImageCacheByteLimit(0u); |
| 816 } | 815 } |
| 817 | 816 |
| 818 void RenderThreadImpl::RegisterSchemes() { | 817 void RenderThreadImpl::RegisterSchemes() { |
| 819 // swappedout: pages should not be accessible, and should also | 818 // swappedout: pages should not be accessible, and should also |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 hidden_widget_count_--; | 1512 hidden_widget_count_--; |
| 1514 | 1513 |
| 1515 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1514 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1516 return; | 1515 return; |
| 1517 } | 1516 } |
| 1518 | 1517 |
| 1519 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1518 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1520 } | 1519 } |
| 1521 | 1520 |
| 1522 } // namespace content | 1521 } // namespace content |
| OLD | NEW |