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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 if (command_line.HasSwitch(switches::kDisableDistanceFieldText)) { | 639 if (command_line.HasSwitch(switches::kDisableDistanceFieldText)) { |
640 is_distance_field_text_enabled_ = false; | 640 is_distance_field_text_enabled_ = false; |
641 } else if (command_line.HasSwitch(switches::kEnableDistanceFieldText)) { | 641 } else if (command_line.HasSwitch(switches::kEnableDistanceFieldText)) { |
642 is_distance_field_text_enabled_ = true; | 642 is_distance_field_text_enabled_ = true; |
643 } else { | 643 } else { |
644 is_distance_field_text_enabled_ = false; | 644 is_distance_field_text_enabled_ = false; |
645 } | 645 } |
646 | 646 |
647 // Note that under Linux, the media library will normally already have | 647 // Note that under Linux, the media library will normally already have |
648 // been initialized by the Zygote before this instance became a Renderer. | 648 // been initialized by the Zygote before this instance became a Renderer. |
649 base::FilePath media_path; | 649 media::InitializeMediaLibrary(); |
650 PathService::Get(DIR_MEDIA_LIBS, &media_path); | |
651 if (!media_path.empty()) | |
652 media::InitializeMediaLibrary(media_path); | |
653 | 650 |
654 memory_pressure_listener_.reset(new base::MemoryPressureListener( | 651 memory_pressure_listener_.reset(new base::MemoryPressureListener( |
655 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 652 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
656 | 653 |
657 compositor_task_graph_runner_.reset(new cc::TaskGraphRunner); | 654 compositor_task_graph_runner_.reset(new cc::TaskGraphRunner); |
658 | 655 |
659 is_gather_pixel_refs_enabled_ = false; | 656 is_gather_pixel_refs_enabled_ = false; |
660 | 657 |
661 if (is_impl_side_painting_enabled_) { | 658 if (is_impl_side_painting_enabled_) { |
662 int num_raster_threads = 0; | 659 int num_raster_threads = 0; |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 | 1096 |
1100 compositor_message_filter_ = new CompositorForwardingMessageFilter( | 1097 compositor_message_filter_ = new CompositorForwardingMessageFilter( |
1101 compositor_impl_side_task_runner.get()); | 1098 compositor_impl_side_task_runner.get()); |
1102 AddFilter(compositor_message_filter_.get()); | 1099 AddFilter(compositor_message_filter_.get()); |
1103 | 1100 |
1104 RenderThreadImpl::RegisterSchemes(); | 1101 RenderThreadImpl::RegisterSchemes(); |
1105 | 1102 |
1106 EnableBlinkPlatformLogChannels( | 1103 EnableBlinkPlatformLogChannels( |
1107 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); | 1104 command_line.GetSwitchValueASCII(switches::kBlinkPlatformLogChannels)); |
1108 | 1105 |
1109 if (!media::IsMediaLibraryInitialized()) { | |
1110 WebRuntimeFeatures::enableWebAudio(false); | |
1111 } | |
1112 | |
1113 RenderMediaClient::Initialize(); | 1106 RenderMediaClient::Initialize(); |
1114 | 1107 |
1115 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); | 1108 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, WebKitInitialized()); |
1116 | 1109 |
1117 devtools_agent_message_filter_ = new DevToolsAgentFilter(); | 1110 devtools_agent_message_filter_ = new DevToolsAgentFilter(); |
1118 AddFilter(devtools_agent_message_filter_.get()); | 1111 AddFilter(devtools_agent_message_filter_.get()); |
1119 | 1112 |
1120 v8_sampling_profiler_.reset(new V8SamplingProfiler()); | 1113 v8_sampling_profiler_.reset(new V8SamplingProfiler()); |
1121 | 1114 |
1122 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) | 1115 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 } | 1891 } |
1899 | 1892 |
1900 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1893 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1901 size_t erased = | 1894 size_t erased = |
1902 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1895 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1903 routing_id_); | 1896 routing_id_); |
1904 DCHECK_EQ(1u, erased); | 1897 DCHECK_EQ(1u, erased); |
1905 } | 1898 } |
1906 | 1899 |
1907 } // namespace content | 1900 } // namespace content |
OLD | NEW |