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/renderer/cast_media_load_deferrer.h" |
11 #include "chromecast/renderer/key_systems_cast.h" | 12 #include "chromecast/renderer/key_systems_cast.h" |
12 #include "components/dns_prefetch/renderer/prescient_networking_dispatcher.h" | 13 #include "components/dns_prefetch/renderer/prescient_networking_dispatcher.h" |
13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/renderer/render_frame.h" |
14 #include "content/public/renderer/render_view.h" | 16 #include "content/public/renderer/render_view.h" |
15 #include "crypto/nss_util.h" | 17 #include "crypto/nss_util.h" |
16 #include "third_party/WebKit/public/platform/WebColor.h" | 18 #include "third_party/WebKit/public/platform/WebColor.h" |
17 #include "third_party/WebKit/public/web/WebSettings.h" | 19 #include "third_party/WebKit/public/web/WebSettings.h" |
18 #include "third_party/WebKit/public/web/WebView.h" | 20 #include "third_party/WebKit/public/web/WebView.h" |
19 | 21 |
20 namespace chromecast { | 22 namespace chromecast { |
21 namespace shell { | 23 namespace shell { |
22 | 24 |
23 namespace { | 25 namespace { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::vector< ::media::KeySystemInfo>* key_systems) { | 69 std::vector< ::media::KeySystemInfo>* key_systems) { |
68 AddChromecastKeySystems(key_systems); | 70 AddChromecastKeySystems(key_systems); |
69 AddChromecastPlatformKeySystems(key_systems); | 71 AddChromecastPlatformKeySystems(key_systems); |
70 } | 72 } |
71 | 73 |
72 blink::WebPrescientNetworking* | 74 blink::WebPrescientNetworking* |
73 CastContentRendererClient::GetPrescientNetworking() { | 75 CastContentRendererClient::GetPrescientNetworking() { |
74 return prescient_networking_dispatcher_.get(); | 76 return prescient_networking_dispatcher_.get(); |
75 } | 77 } |
76 | 78 |
| 79 void CastContentRendererClient::DeferMediaLoad( |
| 80 content::RenderFrame* render_frame, |
| 81 const base::Closure& closure) { |
| 82 if (!render_frame->IsHidden()) { |
| 83 closure.Run(); |
| 84 return; |
| 85 } |
| 86 |
| 87 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. |
| 88 new CastMediaLoadDeferrer(render_frame, closure); |
| 89 } |
| 90 |
77 } // namespace shell | 91 } // namespace shell |
78 } // namespace chromecast | 92 } // namespace chromecast |
OLD | NEW |