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 11 matching lines...) Expand all Loading... |
22 #include "base/metrics/stats_table.h" | 22 #include "base/metrics/stats_table.h" |
23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
24 #include "base/strings/string16.h" | 24 #include "base/strings/string16.h" |
25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
26 #include "base/strings/string_tokenizer.h" | 26 #include "base/strings/string_tokenizer.h" |
27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
28 #include "base/threading/thread_local.h" | 28 #include "base/threading/thread_local.h" |
29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
30 #include "base/values.h" | 30 #include "base/values.h" |
31 #include "cc/base/switches.h" | 31 #include "cc/base/switches.h" |
| 32 #include "cc/blink/web_external_bitmap_impl.h" |
| 33 #include "cc/blink/web_layer_impl.h" |
32 #include "cc/resources/raster_worker_pool.h" | 34 #include "cc/resources/raster_worker_pool.h" |
33 #include "content/child/appcache/appcache_dispatcher.h" | 35 #include "content/child/appcache/appcache_dispatcher.h" |
34 #include "content/child/appcache/appcache_frontend_impl.h" | 36 #include "content/child/appcache/appcache_frontend_impl.h" |
35 #include "content/child/child_histogram_message_filter.h" | 37 #include "content/child/child_histogram_message_filter.h" |
36 #include "content/child/content_child_helpers.h" | 38 #include "content/child/content_child_helpers.h" |
37 #include "content/child/db_message_filter.h" | 39 #include "content/child/db_message_filter.h" |
38 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 40 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
39 #include "content/child/indexed_db/indexed_db_message_filter.h" | 41 #include "content/child/indexed_db/indexed_db_message_filter.h" |
40 #include "content/child/npapi/npobject_util.h" | 42 #include "content/child/npapi/npobject_util.h" |
41 #include "content/child/plugin_messages.h" | 43 #include "content/child/plugin_messages.h" |
(...skipping 17 matching lines...) Expand all Loading... |
59 #include "content/common/view_messages.h" | 61 #include "content/common/view_messages.h" |
60 #include "content/common/worker_messages.h" | 62 #include "content/common/worker_messages.h" |
61 #include "content/public/common/content_constants.h" | 63 #include "content/public/common/content_constants.h" |
62 #include "content/public/common/content_paths.h" | 64 #include "content/public/common/content_paths.h" |
63 #include "content/public/common/content_switches.h" | 65 #include "content/public/common/content_switches.h" |
64 #include "content/public/common/renderer_preferences.h" | 66 #include "content/public/common/renderer_preferences.h" |
65 #include "content/public/common/url_constants.h" | 67 #include "content/public/common/url_constants.h" |
66 #include "content/public/renderer/content_renderer_client.h" | 68 #include "content/public/renderer/content_renderer_client.h" |
67 #include "content/public/renderer/render_process_observer.h" | 69 #include "content/public/renderer/render_process_observer.h" |
68 #include "content/public/renderer/render_view_visitor.h" | 70 #include "content/public/renderer/render_view_visitor.h" |
69 #include "content/renderer/compositor_bindings/web_external_bitmap_impl.h" | |
70 #include "content/renderer/compositor_bindings/web_layer_impl.h" | |
71 #include "content/renderer/devtools/devtools_agent_filter.h" | 71 #include "content/renderer/devtools/devtools_agent_filter.h" |
72 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 72 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
73 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 73 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
74 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 74 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
75 #include "content/renderer/gamepad_shared_memory_reader.h" | 75 #include "content/renderer/gamepad_shared_memory_reader.h" |
76 #include "content/renderer/gpu/compositor_output_surface.h" | 76 #include "content/renderer/gpu/compositor_output_surface.h" |
77 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 77 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
78 #include "content/renderer/input/input_event_filter.h" | 78 #include "content/renderer/input/input_event_filter.h" |
79 #include "content/renderer/input/input_handler_manager.h" | 79 #include "content/renderer/input/input_handler_manager.h" |
80 #include "content/renderer/media/aec_dump_message_filter.h" | 80 #include "content/renderer/media/aec_dump_message_filter.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 GetContentClient()->renderer()->RenderThreadStarted(); | 475 GetContentClient()->renderer()->RenderThreadStarted(); |
476 | 476 |
477 InitSkiaEventTracer(); | 477 InitSkiaEventTracer(); |
478 | 478 |
479 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 479 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
480 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) | 480 if (command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) |
481 RegisterExtension(GpuBenchmarkingExtension::Get()); | 481 RegisterExtension(GpuBenchmarkingExtension::Get()); |
482 | 482 |
483 is_impl_side_painting_enabled_ = | 483 is_impl_side_painting_enabled_ = |
484 command_line.HasSwitch(switches::kEnableImplSidePainting); | 484 command_line.HasSwitch(switches::kEnableImplSidePainting); |
485 WebLayerImpl::SetImplSidePaintingEnabled(is_impl_side_painting_enabled_); | 485 cc_blink::WebLayerImpl::SetImplSidePaintingEnabled( |
| 486 is_impl_side_painting_enabled_); |
486 | 487 |
487 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && | 488 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy) && |
488 !command_line.HasSwitch(switches::kDisableZeroCopy); | 489 !command_line.HasSwitch(switches::kDisableZeroCopy); |
489 | 490 |
490 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); | 491 is_one_copy_enabled_ = command_line.HasSwitch(switches::kEnableOneCopy); |
491 | 492 |
492 if (command_line.HasSwitch(switches::kDisableLCDText)) { | 493 if (command_line.HasSwitch(switches::kDisableLCDText)) { |
493 is_lcd_text_enabled_ = false; | 494 is_lcd_text_enabled_ = false; |
494 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { | 495 } else if (command_line.HasSwitch(switches::kEnableLCDText)) { |
495 is_lcd_text_enabled_ = true; | 496 is_lcd_text_enabled_ = true; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 } | 916 } |
916 | 917 |
917 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); | 918 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); |
918 | 919 |
919 devtools_agent_message_filter_ = new DevToolsAgentFilter(); | 920 devtools_agent_message_filter_ = new DevToolsAgentFilter(); |
920 AddFilter(devtools_agent_message_filter_.get()); | 921 AddFilter(devtools_agent_message_filter_.get()); |
921 | 922 |
922 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) | 923 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
923 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 924 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
924 | 925 |
925 SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); | 926 cc_blink::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction); |
926 | 927 |
927 // Limit use of the scaled image cache to when deferred image decoding is | 928 // Limit use of the scaled image cache to when deferred image decoding is |
928 // enabled. | 929 // enabled. |
929 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && | 930 if (!command_line.HasSwitch(switches::kEnableDeferredImageDecoding) && |
930 !is_impl_side_painting_enabled_) | 931 !is_impl_side_painting_enabled_) |
931 SkGraphics::SetImageCacheByteLimit(0u); | 932 SkGraphics::SetImageCacheByteLimit(0u); |
932 | 933 |
933 SkGraphics::SetImageCacheSingleAllocationByteLimit( | 934 SkGraphics::SetImageCacheSingleAllocationByteLimit( |
934 kImageCacheSingleAllocationByteLimit); | 935 kImageCacheSingleAllocationByteLimit); |
935 | 936 |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 hidden_widget_count_--; | 1654 hidden_widget_count_--; |
1654 | 1655 |
1655 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1656 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
1656 return; | 1657 return; |
1657 } | 1658 } |
1658 | 1659 |
1659 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1660 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
1660 } | 1661 } |
1661 | 1662 |
1662 } // namespace content | 1663 } // namespace content |
OLD | NEW |