| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chromecast/base/chromecast_switches.h" | 13 #include "chromecast/base/chromecast_switches.h" |
| 14 #include "chromecast/common/media/cast_media_client.h" |
| 14 #include "chromecast/crash/cast_crash_keys.h" | 15 #include "chromecast/crash/cast_crash_keys.h" |
| 15 #include "chromecast/media/base/media_caps.h" | 16 #include "chromecast/media/base/media_caps.h" |
| 16 #include "chromecast/renderer/cast_media_load_deferrer.h" | 17 #include "chromecast/renderer/cast_media_load_deferrer.h" |
| 17 #include "chromecast/renderer/cast_render_thread_observer.h" | 18 #include "chromecast/renderer/cast_render_thread_observer.h" |
| 18 #include "chromecast/renderer/key_systems_cast.h" | 19 #include "chromecast/renderer/key_systems_cast.h" |
| 19 #include "chromecast/renderer/media/chromecast_media_renderer_factory.h" | 20 #include "chromecast/renderer/media/chromecast_media_renderer_factory.h" |
| 20 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 21 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
| 21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/renderer/render_frame.h" | 23 #include "content/public/renderer/render_frame.h" |
| 23 #include "content/public/renderer/render_view.h" | 24 #include "content/public/renderer/render_view.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Set the initial known codecs mask. | 67 // Set the initial known codecs mask. |
| 67 if (command_line->HasSwitch(switches::kHdmiSinkSupportedCodecs)) { | 68 if (command_line->HasSwitch(switches::kHdmiSinkSupportedCodecs)) { |
| 68 int hdmi_codecs_mask; | 69 int hdmi_codecs_mask; |
| 69 if (base::StringToInt(command_line->GetSwitchValueASCII( | 70 if (base::StringToInt(command_line->GetSwitchValueASCII( |
| 70 switches::kHdmiSinkSupportedCodecs), | 71 switches::kHdmiSinkSupportedCodecs), |
| 71 &hdmi_codecs_mask)) { | 72 &hdmi_codecs_mask)) { |
| 72 ::media::SetHdmiSinkCodecs(hdmi_codecs_mask); | 73 ::media::SetHdmiSinkCodecs(hdmi_codecs_mask); |
| 73 } | 74 } |
| 74 } | 75 } |
| 75 | 76 |
| 77 chromecast::media::CastMediaClient::Initialize(); |
| 78 |
| 76 cast_observer_.reset(new CastRenderThreadObserver()); | 79 cast_observer_.reset(new CastRenderThreadObserver()); |
| 77 | 80 |
| 78 prescient_networking_dispatcher_.reset( | 81 prescient_networking_dispatcher_.reset( |
| 79 new network_hints::PrescientNetworkingDispatcher()); | 82 new network_hints::PrescientNetworkingDispatcher()); |
| 80 | 83 |
| 81 std::string last_launched_app = | 84 std::string last_launched_app = |
| 82 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); | 85 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); |
| 83 if (!last_launched_app.empty()) | 86 if (!last_launched_app.empty()) |
| 84 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); | 87 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); |
| 85 | 88 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 closure.Run(); | 143 closure.Run(); |
| 141 return; | 144 return; |
| 142 } | 145 } |
| 143 | 146 |
| 144 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. | 147 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. |
| 145 new CastMediaLoadDeferrer(render_frame, closure); | 148 new CastMediaLoadDeferrer(render_frame, closure); |
| 146 } | 149 } |
| 147 | 150 |
| 148 } // namespace shell | 151 } // namespace shell |
| 149 } // namespace chromecast | 152 } // namespace chromecast |
| OLD | NEW |