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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 GetContentClient()->renderer()->RenderThreadStarted(); | 405 GetContentClient()->renderer()->RenderThreadStarted(); |
406 | 406 |
407 InitSkiaEventTracer(); | 407 InitSkiaEventTracer(); |
408 | 408 |
409 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 409 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
410 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 410 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
411 RegisterExtension(GpuBenchmarkingExtension::Get()); | 411 RegisterExtension(GpuBenchmarkingExtension::Get()); |
412 | 412 |
413 is_impl_side_painting_enabled_ = | 413 is_impl_side_painting_enabled_ = |
414 command_line.HasSwitch(switches::kEnableImplSidePainting); | 414 command_line.HasSwitch(switches::kEnableImplSidePainting); |
415 webkit::WebLayerImpl::SetImplSidePaintingEnabled( | 415 WebLayerImpl::SetImplSidePaintingEnabled(is_impl_side_painting_enabled_); |
416 is_impl_side_painting_enabled_); | |
417 | 416 |
418 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && | 417 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && |
419 !command_line.HasSwitch(switches::kDisableZeroCopy); | 418 !command_line.HasSwitch(switches::kDisableZeroCopy); |
420 | 419 |
421 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); | 420 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); |
422 | 421 |
423 if (command_line.HasSwitch(switches::kDisableLCDText)) { | 422 if (command_line.HasSwitch(switches::kDisableLCDText)) { |
424 is_lcd_text_enabled_ = false; | 423 is_lcd_text_enabled_ = false; |
425 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { | 424 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { |
426 is_lcd_text_enabled_ = true; | 425 is_lcd_text_enabled_ = true; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 } | 799 } |
801 | 800 |
802 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); | 801 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); |
803 | 802 |
804 devtools_agent_message_filter_ = new DevToolsAgentFilter(); | 803 devtools_agent_message_filter_ = new DevToolsAgentFilter(); |
805 AddFilter(devtools_agent_message_filter_.get()); | 804 AddFilter(devtools_agent_message_filter_.get()); |
806 | 805 |
807 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) | 806 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
808 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 807 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
809 | 808 |
810 webkit::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); | 809 SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); |
811 | 810 |
812 // Limit use of the scaled image cache to when deferred image decoding is | 811 // Limit use of the scaled image cache to when deferred image decoding is |
813 // enabled. | 812 // enabled. |
814 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && | 813 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && |
815 !is_impl_side_painting_enabled_) | 814 !is_impl_side_painting_enabled_) |
816 SkGraphics::SetImageCacheByteLimit(0u); | 815 SkGraphics::SetImageCacheByteLimit(0u); |
817 } | 816 } |
818 | 817 |
819 void RenderThreadImpl::RegisterSchemes() { | 818 void RenderThreadImpl::RegisterSchemes() { |
820 // swappedout: pages should not be accessible, and should also | 819 // swappedout: pages should not be accessible, and should also |
(...skipping 692 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 |