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

Side by Side Diff: components/html_viewer/html_document.cc

Issue 1124863005: Restrict use of hardware-secure codecs based on the RendererPreference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setsecurity
Patch Set: Correct unittests. Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/html_viewer/html_document.h" 5 #include "components/html_viewer/html_document.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // TODO(jam): pass referrer and other HTTP data to NavigatorHost so we can 102 // TODO(jam): pass referrer and other HTTP data to NavigatorHost so we can
103 // use a new process in this case. 103 // use a new process in this case.
104 if (!request.httpHeaderField(blink::WebString::fromUTF8("Referer")).isEmpty()) 104 if (!request.httpHeaderField(blink::WebString::fromUTF8("Referer")).isEmpty())
105 return true; 105 return true;
106 106
107 // Otherwise we don't know if we're the right app to handle this request. Ask 107 // Otherwise we don't know if we're the right app to handle this request. Ask
108 // host to do the navigation for us. 108 // host to do the navigation for us.
109 return false; 109 return false;
110 } 110 }
111 111
112 bool AreSecureCodecsSupported() {
113 // Hardware-secure codecs are not currently supported by HTML Viewer on any
114 // platform.
115 return false;
116 }
117
112 } // namespace 118 } // namespace
113 119
114 HTMLDocument::HTMLDocument( 120 HTMLDocument::HTMLDocument(
115 mojo::InterfaceRequest<mojo::ServiceProvider> services, 121 mojo::InterfaceRequest<mojo::ServiceProvider> services,
116 URLResponsePtr response, 122 URLResponsePtr response,
117 mojo::Shell* shell, 123 mojo::Shell* shell,
118 scoped_refptr<base::MessageLoopProxy> compositor_thread, 124 scoped_refptr<base::MessageLoopProxy> compositor_thread,
119 WebMediaPlayerFactory* web_media_player_factory, 125 WebMediaPlayerFactory* web_media_player_factory,
120 bool is_headless) 126 bool is_headless)
121 : response_(response.Pass()), 127 : response_(response.Pass()),
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 blink::WebLocalFrame* frame, 327 blink::WebLocalFrame* frame,
322 const blink::WebHistoryItem& history_item, 328 const blink::WebHistoryItem& history_item,
323 blink::WebHistoryCommitType commit_type) { 329 blink::WebHistoryCommitType commit_type) {
324 if (navigator_host_.get()) 330 if (navigator_host_.get())
325 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); 331 navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
326 } 332 }
327 333
328 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { 334 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
329 if (!web_encrypted_media_client_) { 335 if (!web_encrypted_media_client_) {
330 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( 336 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl(
331 GetCdmFactory(), GetMediaPermission())); 337 base::Bind(&AreSecureCodecsSupported), GetCdmFactory(),
338 GetMediaPermission()));
332 } 339 }
333 return web_encrypted_media_client_.get(); 340 return web_encrypted_media_client_.get();
334 } 341 }
335 342
336 void HTMLDocument::OnViewBoundsChanged(View* view, 343 void HTMLDocument::OnViewBoundsChanged(View* view,
337 const Rect& old_bounds, 344 const Rect& old_bounds,
338 const Rect& new_bounds) { 345 const Rect& new_bounds) {
339 DCHECK_EQ(view, root_); 346 DCHECK_EQ(view, root_);
340 UpdateWebviewSizeFromViewSize(); 347 UpdateWebviewSizeFromViewSize();
341 } 348 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return media_permission_.get(); 383 return media_permission_.get();
377 } 384 }
378 385
379 media::CdmFactory* HTMLDocument::GetCdmFactory() { 386 media::CdmFactory* HTMLDocument::GetCdmFactory() {
380 if (!cdm_factory_) 387 if (!cdm_factory_)
381 cdm_factory_.reset(new media::DefaultCdmFactory()); 388 cdm_factory_.reset(new media::DefaultCdmFactory());
382 return cdm_factory_.get(); 389 return cdm_factory_.get();
383 } 390 }
384 391
385 } // namespace html_viewer 392 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698