Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: chromecast/browser/cast_content_window.cc

Issue 2006113002: Allow hw secured codecs on chromecast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New flag, new key system property Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/browser/cast_content_window.cc
diff --git a/chromecast/browser/cast_content_window.cc b/chromecast/browser/cast_content_window.cc
index cd7e7e231a4f5497b009ce2c54b86488118c4ba7..feaaf267f591003b967f49be384373368dab06eb 100644
--- a/chromecast/browser/cast_content_window.cc
+++ b/chromecast/browser/cast_content_window.cc
@@ -9,10 +9,12 @@
#include "base/threading/thread_restrictions.h"
#include "chromecast/base/metrics/cast_metrics_helper.h"
#include "chromecast/browser/cast_browser_process.h"
+#include "chromecast/chromecast_features.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/renderer_preferences.h"
#include "ipc/ipc_message.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
@@ -107,12 +109,22 @@ std::unique_ptr<content::WebContents> CastContentWindow::CreateWebContents(
gfx::Size display_size =
display::Screen::GetScreen()->GetPrimaryDisplay().size();
- content::WebContents::CreateParams create_params(browser_context, NULL);
+ content::WebContents::CreateParams create_params(browser_context, nullptr);
create_params.routing_id = MSG_ROUTING_NONE;
create_params.initial_size = display_size;
content::WebContents* web_contents = content::WebContents::Create(
create_params);
content::WebContentsObserver::Observe(web_contents);
+
+#if !BUILDFLAG(DISABLE_DISPLAY)
+ content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs();
+ prefs->hw_secure_codec_allowed = true;
+
+ content::RenderViewHost* host = web_contents->GetRenderViewHost();
+ if (host)
+ host->SyncRendererPrefs();
+#endif // !BUILDFLAG(DISABLE_DISPLAY)
+
return base::WrapUnique(web_contents);
}

Powered by Google App Engine
This is Rietveld 408576698