| 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 "chromecast/common/chromecast_switches.h" | 11 #include "chromecast/common/chromecast_switches.h" |
| 12 #include "chromecast/renderer/cast_media_load_deferrer.h" |
| 12 #include "chromecast/renderer/key_systems_cast.h" | 13 #include "chromecast/renderer/key_systems_cast.h" |
| 13 #include "chromecast/renderer/media/cma_media_renderer_factory.h" | 14 #include "chromecast/renderer/media/cma_media_renderer_factory.h" |
| 14 #include "components/dns_prefetch/renderer/prescient_networking_dispatcher.h" | 15 #include "components/dns_prefetch/renderer/prescient_networking_dispatcher.h" |
| 15 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 16 #include "content/public/renderer/render_frame.h" | 17 #include "content/public/renderer/render_frame.h" |
| 17 #include "content/public/renderer/render_view.h" | 18 #include "content/public/renderer/render_view.h" |
| 18 #include "crypto/nss_util.h" | 19 #include "crypto/nss_util.h" |
| 19 #include "third_party/WebKit/public/platform/WebColor.h" | 20 #include "third_party/WebKit/public/platform/WebColor.h" |
| 20 #include "third_party/WebKit/public/web/WebSettings.h" | 21 #include "third_party/WebKit/public/web/WebSettings.h" |
| 21 #include "third_party/WebKit/public/web/WebView.h" | 22 #include "third_party/WebKit/public/web/WebView.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return scoped_ptr<::media::RendererFactory>( | 83 return scoped_ptr<::media::RendererFactory>( |
| 83 new chromecast::media::CmaMediaRendererFactory( | 84 new chromecast::media::CmaMediaRendererFactory( |
| 84 render_frame->GetRoutingID())); | 85 render_frame->GetRoutingID())); |
| 85 } | 86 } |
| 86 | 87 |
| 87 blink::WebPrescientNetworking* | 88 blink::WebPrescientNetworking* |
| 88 CastContentRendererClient::GetPrescientNetworking() { | 89 CastContentRendererClient::GetPrescientNetworking() { |
| 89 return prescient_networking_dispatcher_.get(); | 90 return prescient_networking_dispatcher_.get(); |
| 90 } | 91 } |
| 91 | 92 |
| 93 void CastContentRendererClient::DeferMediaLoad( |
| 94 content::RenderFrame* render_frame, |
| 95 const base::Closure& closure) { |
| 96 if (!render_frame->IsHidden()) { |
| 97 closure.Run(); |
| 98 return; |
| 99 } |
| 100 |
| 101 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. |
| 102 new CastMediaLoadDeferrer(render_frame, closure); |
| 103 } |
| 104 |
| 92 } // namespace shell | 105 } // namespace shell |
| 93 } // namespace chromecast | 106 } // namespace chromecast |
| OLD | NEW |