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