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

Side by Side Diff: android_webview/renderer/aw_content_renderer_client.cc

Issue 2952583002: SafeBrowsing support for WebSocket (post-network-servicification) (Closed)
Patch Set: Revert change to WebSocketHandshakeThrottle.h Created 3 years, 6 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "android_webview/renderer/aw_content_renderer_client.h" 5 #include "android_webview/renderer/aw_content_renderer_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/common/aw_switches.h" 9 #include "android_webview/common/aw_switches.h"
10 #include "android_webview/common/render_view_messages.h" 10 #include "android_webview/common/render_view_messages.h"
11 #include "android_webview/common/url_constants.h" 11 #include "android_webview/common/url_constants.h"
12 #include "android_webview/grit/aw_resources.h" 12 #include "android_webview/grit/aw_resources.h"
13 #include "android_webview/grit/aw_strings.h" 13 #include "android_webview/grit/aw_strings.h"
14 #include "android_webview/renderer/aw_content_settings_client.h" 14 #include "android_webview/renderer/aw_content_settings_client.h"
15 #include "android_webview/renderer/aw_key_systems.h" 15 #include "android_webview/renderer/aw_key_systems.h"
16 #include "android_webview/renderer/aw_print_web_view_helper_delegate.h" 16 #include "android_webview/renderer/aw_print_web_view_helper_delegate.h"
17 #include "android_webview/renderer/aw_render_frame_ext.h" 17 #include "android_webview/renderer/aw_render_frame_ext.h"
18 #include "android_webview/renderer/aw_render_view_ext.h" 18 #include "android_webview/renderer/aw_render_view_ext.h"
19 #include "android_webview/renderer/print_render_frame_observer.h" 19 #include "android_webview/renderer/print_render_frame_observer.h"
20 #include "base/command_line.h" 20 #include "base/command_line.h"
21 #include "base/i18n/rtl.h" 21 #include "base/i18n/rtl.h"
22 #include "base/memory/ptr_util.h" 22 #include "base/memory/ptr_util.h"
23 #include "base/message_loop/message_loop.h" 23 #include "base/message_loop/message_loop.h"
24 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
25 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
26 #include "components/autofill/content/renderer/autofill_agent.h" 26 #include "components/autofill/content/renderer/autofill_agent.h"
27 #include "components/autofill/content/renderer/password_autofill_agent.h" 27 #include "components/autofill/content/renderer/password_autofill_agent.h"
28 #include "components/printing/renderer/print_web_view_helper.h" 28 #include "components/printing/renderer/print_web_view_helper.h"
29 #include "components/safe_browsing/renderer/websocket_sb_handshake_throttle.h"
29 #include "components/spellcheck/spellcheck_build_features.h" 30 #include "components/spellcheck/spellcheck_build_features.h"
30 #include "components/supervised_user_error_page/gin_wrapper.h" 31 #include "components/supervised_user_error_page/gin_wrapper.h"
31 #include "components/supervised_user_error_page/supervised_user_error_page_andro id.h" 32 #include "components/supervised_user_error_page/supervised_user_error_page_andro id.h"
32 #include "components/visitedlink/renderer/visitedlink_slave.h" 33 #include "components/visitedlink/renderer/visitedlink_slave.h"
33 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" 34 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h"
34 #include "content/public/child/child_thread.h" 35 #include "content/public/child/child_thread.h"
35 #include "content/public/common/service_manager_connection.h" 36 #include "content/public/common/service_manager_connection.h"
36 #include "content/public/common/simple_connection_filter.h" 37 #include "content/public/common/simple_connection_filter.h"
37 #include "content/public/common/url_constants.h" 38 #include "content/public/common/url_constants.h"
38 #include "content/public/renderer/document_state.h" 39 #include "content/public/renderer/document_state.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 291
291 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { 292 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
292 return visited_link_slave_->IsVisited(link_hash); 293 return visited_link_slave_->IsVisited(link_hash);
293 } 294 }
294 295
295 void AwContentRendererClient::AddSupportedKeySystems( 296 void AwContentRendererClient::AddSupportedKeySystems(
296 std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) { 297 std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
297 AwAddKeySystems(key_systems); 298 AwAddKeySystems(key_systems);
298 } 299 }
299 300
301 std::unique_ptr<blink::WebSocketHandshakeThrottle>
302 AwContentRendererClient::CreateWebSocketHandshakeThrottle() {
303 return safe_browsing::WebSocketSBHandshakeThrottle::MaybeCreate(
304 &safe_browsing_);
305 }
306
300 bool AwContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) { 307 bool AwContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
301 // Android WebView needs to support codecs that Chrome does not, for these 308 // Android WebView needs to support codecs that Chrome does not, for these
302 // cases we must force the usage of Android MediaPlayer instead of Chrome's 309 // cases we must force the usage of Android MediaPlayer instead of Chrome's
303 // internal player. 310 // internal player.
304 // 311 //
305 // Note: Despite these extensions being forwarded for playback to MediaPlayer, 312 // Note: Despite these extensions being forwarded for playback to MediaPlayer,
306 // HTMLMediaElement.canPlayType() will return empty for these containers. 313 // HTMLMediaElement.canPlayType() will return empty for these containers.
307 // TODO(boliu): If this is important, extend media::MimeUtil for WebView. 314 // TODO(boliu): If this is important, extend media::MimeUtil for WebView.
308 // 315 //
309 // Format list mirrors: 316 // Format list mirrors:
310 // http://developer.android.com/guide/appendix/media-formats.html 317 // http://developer.android.com/guide/appendix/media-formats.html
311 static const char* kMediaPlayerExtensions[] = { 318 static const char* kMediaPlayerExtensions[] = {
312 ".3gp", ".ts", ".flac", ".mid", ".xmf", 319 ".3gp", ".ts", ".flac", ".mid", ".xmf",
313 ".mxmf", ".rtttl", ".rtx", ".ota", ".imy"}; 320 ".mxmf", ".rtttl", ".rtx", ".ota", ".imy"};
314 for (auto* extension : kMediaPlayerExtensions) { 321 for (auto* extension : kMediaPlayerExtensions) {
315 if (base::EndsWith(url.path(), extension, 322 if (base::EndsWith(url.path(), extension,
316 base::CompareCase::INSENSITIVE_ASCII)) { 323 base::CompareCase::INSENSITIVE_ASCII)) {
317 return true; 324 return true;
318 } 325 }
319 } 326 }
320 return false; 327 return false;
321 } 328 }
322 329
323 } // namespace android_webview 330 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698