| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "content/renderer/render_thread_impl.h" | 71 #include "content/renderer/render_thread_impl.h" |
| 72 #include "content/renderer/renderer_clipboard_delegate.h" | 72 #include "content/renderer/renderer_clipboard_delegate.h" |
| 73 #include "content/renderer/screen_orientation/screen_orientation_observer.h" | 73 #include "content/renderer/screen_orientation/screen_orientation_observer.h" |
| 74 #include "content/renderer/webclipboard_impl.h" | 74 #include "content/renderer/webclipboard_impl.h" |
| 75 #include "content/renderer/webgraphicscontext3d_provider_impl.h" | 75 #include "content/renderer/webgraphicscontext3d_provider_impl.h" |
| 76 #include "content/renderer/webpublicsuffixlist_impl.h" | 76 #include "content/renderer/webpublicsuffixlist_impl.h" |
| 77 #include "gpu/config/gpu_info.h" | 77 #include "gpu/config/gpu_info.h" |
| 78 #include "ipc/ipc_sync_message_filter.h" | 78 #include "ipc/ipc_sync_message_filter.h" |
| 79 #include "media/audio/audio_output_device.h" | 79 #include "media/audio/audio_output_device.h" |
| 80 #include "media/base/audio_hardware_config.h" | 80 #include "media/base/audio_hardware_config.h" |
| 81 #include "media/base/key_systems.h" | |
| 82 #include "media/base/mime_util.h" | 81 #include "media/base/mime_util.h" |
| 83 #include "media/blink/webcontentdecryptionmodule_impl.h" | 82 #include "media/blink/webcontentdecryptionmodule_impl.h" |
| 84 #include "media/filters/stream_parser_factory.h" | 83 #include "media/filters/stream_parser_factory.h" |
| 85 #include "storage/common/database/database_identifier.h" | 84 #include "storage/common/database/database_identifier.h" |
| 86 #include "storage/common/quota/quota_types.h" | 85 #include "storage/common/quota/quota_types.h" |
| 87 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 86 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
| 88 #include "third_party/WebKit/public/platform/URLConversion.h" | 87 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 89 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" | 88 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" |
| 90 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 89 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
| 91 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" | 90 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 184 |
| 186 } // namespace | 185 } // namespace |
| 187 | 186 |
| 188 //------------------------------------------------------------------------------ | 187 //------------------------------------------------------------------------------ |
| 189 | 188 |
| 190 class RendererBlinkPlatformImpl::MimeRegistry | 189 class RendererBlinkPlatformImpl::MimeRegistry |
| 191 : public SimpleWebMimeRegistryImpl { | 190 : public SimpleWebMimeRegistryImpl { |
| 192 public: | 191 public: |
| 193 blink::WebMimeRegistry::SupportsType supportsMediaMIMEType( | 192 blink::WebMimeRegistry::SupportsType supportsMediaMIMEType( |
| 194 const blink::WebString& mime_type, | 193 const blink::WebString& mime_type, |
| 195 const blink::WebString& codecs, | 194 const blink::WebString& codecs) override; |
| 196 const blink::WebString& key_system) override; | |
| 197 bool supportsMediaSourceMIMEType(const blink::WebString& mime_type, | 195 bool supportsMediaSourceMIMEType(const blink::WebString& mime_type, |
| 198 const blink::WebString& codecs) override; | 196 const blink::WebString& codecs) override; |
| 199 blink::WebString mimeTypeForExtension( | 197 blink::WebString mimeTypeForExtension( |
| 200 const blink::WebString& file_extension) override; | 198 const blink::WebString& file_extension) override; |
| 201 }; | 199 }; |
| 202 | 200 |
| 203 class RendererBlinkPlatformImpl::FileUtilities : public WebFileUtilitiesImpl { | 201 class RendererBlinkPlatformImpl::FileUtilities : public WebFileUtilitiesImpl { |
| 204 public: | 202 public: |
| 205 explicit FileUtilities(ThreadSafeSender* sender) | 203 explicit FileUtilities(ThreadSafeSender* sender) |
| 206 : thread_safe_sender_(sender) {} | 204 : thread_safe_sender_(sender) {} |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 445 |
| 448 WebFileSystem* RendererBlinkPlatformImpl::fileSystem() { | 446 WebFileSystem* RendererBlinkPlatformImpl::fileSystem() { |
| 449 return WebFileSystemImpl::ThreadSpecificInstance(default_task_runner_); | 447 return WebFileSystemImpl::ThreadSpecificInstance(default_task_runner_); |
| 450 } | 448 } |
| 451 | 449 |
| 452 //------------------------------------------------------------------------------ | 450 //------------------------------------------------------------------------------ |
| 453 | 451 |
| 454 WebMimeRegistry::SupportsType | 452 WebMimeRegistry::SupportsType |
| 455 RendererBlinkPlatformImpl::MimeRegistry::supportsMediaMIMEType( | 453 RendererBlinkPlatformImpl::MimeRegistry::supportsMediaMIMEType( |
| 456 const WebString& mime_type, | 454 const WebString& mime_type, |
| 457 const WebString& codecs, | 455 const WebString& codecs) { |
| 458 const WebString& key_system) { | |
| 459 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); | 456 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); |
| 460 | 457 |
| 461 if (!key_system.isEmpty()) { | |
| 462 // Check whether the key system is supported with the mime_type and codecs. | |
| 463 | |
| 464 // Chromium only supports ASCII parameters. | |
| 465 if (!base::IsStringASCII(key_system)) | |
| 466 return IsNotSupported; | |
| 467 | |
| 468 std::string key_system_ascii = | |
| 469 media::GetUnprefixedKeySystemName(base::UTF16ToASCII( | |
| 470 base::StringPiece16(key_system))); | |
| 471 std::vector<std::string> codec_vector; | |
| 472 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, true); | |
| 473 | |
| 474 if (!media::PrefixedIsSupportedKeySystemWithMediaMimeType( | |
| 475 mime_type_ascii, codec_vector, key_system_ascii)) { | |
| 476 return IsNotSupported; | |
| 477 } | |
| 478 | |
| 479 // Continue processing the mime_type and codecs. | |
| 480 } | |
| 481 | |
| 482 std::vector<std::string> codec_vector; | 458 std::vector<std::string> codec_vector; |
| 483 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, false); | 459 media::ParseCodecString(ToASCIIOrEmpty(codecs), &codec_vector, false); |
| 484 return static_cast<WebMimeRegistry::SupportsType>( | 460 return static_cast<WebMimeRegistry::SupportsType>( |
| 485 media::IsSupportedMediaFormat(mime_type_ascii, codec_vector)); | 461 media::IsSupportedMediaFormat(mime_type_ascii, codec_vector)); |
| 486 } | 462 } |
| 487 | 463 |
| 488 bool RendererBlinkPlatformImpl::MimeRegistry::supportsMediaSourceMIMEType( | 464 bool RendererBlinkPlatformImpl::MimeRegistry::supportsMediaSourceMIMEType( |
| 489 const blink::WebString& mime_type, | 465 const blink::WebString& mime_type, |
| 490 const WebString& codecs) { | 466 const WebString& codecs) { |
| 491 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); | 467 const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type); |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 } | 1276 } |
| 1301 | 1277 |
| 1302 //------------------------------------------------------------------------------ | 1278 //------------------------------------------------------------------------------ |
| 1303 | 1279 |
| 1304 blink::WebTrialTokenValidator* | 1280 blink::WebTrialTokenValidator* |
| 1305 RendererBlinkPlatformImpl::trialTokenValidator() { | 1281 RendererBlinkPlatformImpl::trialTokenValidator() { |
| 1306 return &trial_token_validator_; | 1282 return &trial_token_validator_; |
| 1307 } | 1283 } |
| 1308 | 1284 |
| 1309 } // namespace content | 1285 } // namespace content |
| OLD | NEW |