| 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/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" | 5 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 int32_t PepperFlashFileMessageFilter::OnQueryFile( | 202 int32_t PepperFlashFileMessageFilter::OnQueryFile( |
| 203 ppapi::host::HostMessageContext* context, | 203 ppapi::host::HostMessageContext* context, |
| 204 const ppapi::PepperFilePath& path) { | 204 const ppapi::PepperFilePath& path) { |
| 205 base::FilePath full_path = ValidateAndConvertPepperFilePath( | 205 base::FilePath full_path = ValidateAndConvertPepperFilePath( |
| 206 path, base::Bind(&CanRead)); | 206 path, base::Bind(&CanRead)); |
| 207 if (full_path.empty()) { | 207 if (full_path.empty()) { |
| 208 return ppapi::PlatformFileErrorToPepperError( | 208 return ppapi::PlatformFileErrorToPepperError( |
| 209 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); | 209 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // TODO(rvargas): convert this code to use base::File::Info. |
| 212 base::PlatformFileInfo info; | 213 base::PlatformFileInfo info; |
| 213 bool result = base::GetFileInfo(full_path, &info); | 214 bool result = base::GetFileInfo(full_path, |
| 215 reinterpret_cast<base::File::Info*>(&info)); |
| 214 context->reply_msg = PpapiPluginMsg_FlashFile_QueryFileReply(info); | 216 context->reply_msg = PpapiPluginMsg_FlashFile_QueryFileReply(info); |
| 215 return ppapi::PlatformFileErrorToPepperError(result ? | 217 return ppapi::PlatformFileErrorToPepperError(result ? |
| 216 base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_ACCESS_DENIED); | 218 base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_ACCESS_DENIED); |
| 217 } | 219 } |
| 218 | 220 |
| 219 int32_t PepperFlashFileMessageFilter::OnGetDirContents( | 221 int32_t PepperFlashFileMessageFilter::OnGetDirContents( |
| 220 ppapi::host::HostMessageContext* context, | 222 ppapi::host::HostMessageContext* context, |
| 221 const ppapi::PepperFilePath& path) { | 223 const ppapi::PepperFilePath& path) { |
| 222 base::FilePath full_path = ValidateAndConvertPepperFilePath( | 224 base::FilePath full_path = ValidateAndConvertPepperFilePath( |
| 223 path, base::Bind(&CanRead)); | 225 path, base::Bind(&CanRead)); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 file_path = plugin_data_directory_.Append(pepper_path.path()); | 309 file_path = plugin_data_directory_.Append(pepper_path.path()); |
| 308 break; | 310 break; |
| 309 default: | 311 default: |
| 310 NOTREACHED(); | 312 NOTREACHED(); |
| 311 break; | 313 break; |
| 312 } | 314 } |
| 313 return file_path; | 315 return file_path; |
| 314 } | 316 } |
| 315 | 317 |
| 316 } // namespace content | 318 } // namespace content |
| OLD | NEW |