Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/renderer/cast_content_renderer_client.h" | 5 #include "chromecast/renderer/cast_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <sys/sysinfo.h> | 7 #include <sys/sysinfo.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/memory_pressure_listener.h" | 10 #include "base/memory/memory_pressure_listener.h" |
| 11 #include "base/strings/string_number_conversions.h" | |
| 11 #include "chromecast/common/chromecast_switches.h" | 12 #include "chromecast/common/chromecast_switches.h" |
| 12 #include "chromecast/crash/cast_crash_keys.h" | 13 #include "chromecast/crash/cast_crash_keys.h" |
| 14 #include "chromecast/media/base/media_caps.h" | |
| 13 #include "chromecast/renderer/cast_media_load_deferrer.h" | 15 #include "chromecast/renderer/cast_media_load_deferrer.h" |
| 14 #include "chromecast/renderer/cast_render_process_observer.h" | 16 #include "chromecast/renderer/cast_render_process_observer.h" |
| 15 #include "chromecast/renderer/key_systems_cast.h" | 17 #include "chromecast/renderer/key_systems_cast.h" |
| 16 #include "chromecast/renderer/media/cma_media_renderer_factory.h" | 18 #include "chromecast/renderer/media/cma_media_renderer_factory.h" |
| 17 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 19 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
| 18 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
| 19 #include "content/public/renderer/render_frame.h" | 21 #include "content/public/renderer/render_frame.h" |
| 20 #include "content/public/renderer/render_view.h" | 22 #include "content/public/renderer/render_view.h" |
| 21 #include "content/public/renderer/render_view_observer.h" | 23 #include "content/public/renderer/render_view_observer.h" |
| 22 #include "crypto/nss_util.h" | 24 #include "crypto/nss_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 // initialize NSS now because it won't be able to load the .so's | 102 // initialize NSS now because it won't be able to load the .so's |
| 101 // after entering the sandbox. | 103 // after entering the sandbox. |
| 102 if (!command_line->HasSwitch(switches::kSingleProcess)) | 104 if (!command_line->HasSwitch(switches::kSingleProcess)) |
| 103 crypto::InitNSSSafely(); | 105 crypto::InitNSSSafely(); |
| 104 #endif | 106 #endif |
| 105 | 107 |
| 106 #if defined(ARCH_CPU_ARM_FAMILY) && !defined(OS_ANDROID) | 108 #if defined(ARCH_CPU_ARM_FAMILY) && !defined(OS_ANDROID) |
| 107 PlatformPollFreemem(); | 109 PlatformPollFreemem(); |
| 108 #endif | 110 #endif |
| 109 | 111 |
| 112 // Set the initial known codecs mask. | |
| 113 if (command_line->HasSwitch(switches::kHdmiSinkSupportedCodecs)) { | |
| 114 int hdmi_codecs_mask; | |
| 115 if (base::StringToInt(command_line->GetSwitchValueASCII( | |
| 116 switches::kHdmiSinkSupportedCodecs), | |
| 117 &hdmi_codecs_mask)) { | |
|
lcwu1
2015/03/03 20:11:11
Indentation
gunsch
2015/03/04 02:35:47
Done.
| |
| 118 ::media::SetHdmiSinkCodecs(hdmi_codecs_mask); | |
| 119 } | |
| 120 } | |
| 121 | |
| 110 cast_observer_.reset( | 122 cast_observer_.reset( |
| 111 new CastRenderProcessObserver(PlatformGetRendererMessageFilters())); | 123 new CastRenderProcessObserver(PlatformGetRendererMessageFilters())); |
| 112 | 124 |
| 113 prescient_networking_dispatcher_.reset( | 125 prescient_networking_dispatcher_.reset( |
| 114 new network_hints::PrescientNetworkingDispatcher()); | 126 new network_hints::PrescientNetworkingDispatcher()); |
| 115 | 127 |
| 116 std::string last_launched_app = | 128 std::string last_launched_app = |
| 117 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); | 129 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); |
| 118 if (!last_launched_app.empty()) | 130 if (!last_launched_app.empty()) |
| 119 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); | 131 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 closure.Run(); | 189 closure.Run(); |
| 178 return; | 190 return; |
| 179 } | 191 } |
| 180 | 192 |
| 181 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. | 193 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. |
| 182 new CastMediaLoadDeferrer(render_frame, closure); | 194 new CastMediaLoadDeferrer(render_frame, closure); |
| 183 } | 195 } |
| 184 | 196 |
| 185 } // namespace shell | 197 } // namespace shell |
| 186 } // namespace chromecast | 198 } // namespace chromecast |
| OLD | NEW |