| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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" | 81 #include "media/base/key_systems.h" |
| 82 #include "media/base/mime_util.h" | 82 #include "media/base/mime_util.h" |
| 83 #include "media/blink/webcontentdecryptionmodule_impl.h" | 83 #include "media/blink/webcontentdecryptionmodule_impl.h" |
| 84 #include "media/filters/stream_parser_factory.h" | 84 #include "media/filters/stream_parser_factory.h" |
| 85 #include "storage/common/database/database_identifier.h" | 85 #include "storage/common/database/database_identifier.h" |
| 86 #include "storage/common/quota/quota_types.h" | 86 #include "storage/common/quota/quota_types.h" |
| 87 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
| 87 #include "third_party/WebKit/public/platform/URLConversion.h" | 88 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 88 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" | 89 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" |
| 89 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 90 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
| 90 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" | 91 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" |
| 91 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 92 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
| 92 #include "third_party/WebKit/public/platform/WebGamepads.h" | 93 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 93 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 94 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 94 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" | 95 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" |
| 95 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 96 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
| 96 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 97 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 WebString RendererBlinkPlatformImpl::MimeRegistry::mimeTypeForExtension( | 500 WebString RendererBlinkPlatformImpl::MimeRegistry::mimeTypeForExtension( |
| 500 const WebString& file_extension) { | 501 const WebString& file_extension) { |
| 501 if (IsPluginProcess()) | 502 if (IsPluginProcess()) |
| 502 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); | 503 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); |
| 503 | 504 |
| 504 // The sandbox restricts our access to the registry, so we need to proxy | 505 // The sandbox restricts our access to the registry, so we need to proxy |
| 505 // these calls over to the browser process. | 506 // these calls over to the browser process. |
| 506 std::string mime_type; | 507 std::string mime_type; |
| 507 RenderThread::Get()->Send( | 508 RenderThread::Get()->Send( |
| 508 new MimeRegistryMsg_GetMimeTypeFromExtension( | 509 new MimeRegistryMsg_GetMimeTypeFromExtension( |
| 509 base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type)); | 510 blink::WebStringToFilePath(file_extension).value(), &mime_type)); |
| 510 return base::ASCIIToUTF16(mime_type); | 511 return base::ASCIIToUTF16(mime_type); |
| 511 } | 512 } |
| 512 | 513 |
| 513 //------------------------------------------------------------------------------ | 514 //------------------------------------------------------------------------------ |
| 514 | 515 |
| 515 bool RendererBlinkPlatformImpl::FileUtilities::getFileInfo( | 516 bool RendererBlinkPlatformImpl::FileUtilities::getFileInfo( |
| 516 const WebString& path, | 517 const WebString& path, |
| 517 WebFileInfo& web_file_info) { | 518 WebFileInfo& web_file_info) { |
| 518 base::File::Info file_info; | 519 base::File::Info file_info; |
| 519 base::File::Error status = base::File::FILE_ERROR_MAX; | 520 base::File::Error status = base::File::FILE_ERROR_MAX; |
| 520 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( | 521 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( |
| 521 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 522 blink::WebStringToFilePath(path), &file_info, &status)) || |
| 522 status != base::File::FILE_OK) { | 523 status != base::File::FILE_OK) { |
| 523 return false; | 524 return false; |
| 524 } | 525 } |
| 525 FileInfoToWebFileInfo(file_info, &web_file_info); | 526 FileInfoToWebFileInfo(file_info, &web_file_info); |
| 526 web_file_info.platformPath = path; | 527 web_file_info.platformPath = path; |
| 527 return true; | 528 return true; |
| 528 } | 529 } |
| 529 | 530 |
| 530 bool RendererBlinkPlatformImpl::FileUtilities::SendSyncMessageFromAnyThread( | 531 bool RendererBlinkPlatformImpl::FileUtilities::SendSyncMessageFromAnyThread( |
| 531 IPC::SyncMessage* msg) const { | 532 IPC::SyncMessage* msg) const { |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 } | 1300 } |
| 1300 | 1301 |
| 1301 //------------------------------------------------------------------------------ | 1302 //------------------------------------------------------------------------------ |
| 1302 | 1303 |
| 1303 blink::WebTrialTokenValidator* | 1304 blink::WebTrialTokenValidator* |
| 1304 RendererBlinkPlatformImpl::trialTokenValidator() { | 1305 RendererBlinkPlatformImpl::trialTokenValidator() { |
| 1305 return &trial_token_validator_; | 1306 return &trial_token_validator_; |
| 1306 } | 1307 } |
| 1307 | 1308 |
| 1308 } // namespace content | 1309 } // namespace content |
| OLD | NEW |