| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const ppapi::PepperFilePath& to_path) { | 150 const ppapi::PepperFilePath& to_path) { |
| 151 base::FilePath from_full_path = ValidateAndConvertPepperFilePath( | 151 base::FilePath from_full_path = ValidateAndConvertPepperFilePath( |
| 152 from_path, kWritePermissions); | 152 from_path, kWritePermissions); |
| 153 base::FilePath to_full_path = ValidateAndConvertPepperFilePath( | 153 base::FilePath to_full_path = ValidateAndConvertPepperFilePath( |
| 154 to_path, kWritePermissions); | 154 to_path, kWritePermissions); |
| 155 if (from_full_path.empty() || to_full_path.empty()) { | 155 if (from_full_path.empty() || to_full_path.empty()) { |
| 156 return ppapi::PlatformFileErrorToPepperError( | 156 return ppapi::PlatformFileErrorToPepperError( |
| 157 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); | 157 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool result = file_util::Move(from_full_path, to_full_path); | 160 bool result = base::Move(from_full_path, to_full_path); |
| 161 return ppapi::PlatformFileErrorToPepperError(result ? | 161 return ppapi::PlatformFileErrorToPepperError(result ? |
| 162 base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_ACCESS_DENIED); | 162 base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_ACCESS_DENIED); |
| 163 } | 163 } |
| 164 | 164 |
| 165 int32_t PepperFlashFileMessageFilter::OnDeleteFileOrDir( | 165 int32_t PepperFlashFileMessageFilter::OnDeleteFileOrDir( |
| 166 ppapi::host::HostMessageContext* context, | 166 ppapi::host::HostMessageContext* context, |
| 167 const ppapi::PepperFilePath& path, | 167 const ppapi::PepperFilePath& path, |
| 168 bool recursive) { | 168 bool recursive) { |
| 169 base::FilePath full_path = ValidateAndConvertPepperFilePath( | 169 base::FilePath full_path = ValidateAndConvertPepperFilePath( |
| 170 path, kWritePermissions); | 170 path, kWritePermissions); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 file_path = plugin_data_directory_.Append(pepper_path.path()); | 300 file_path = plugin_data_directory_.Append(pepper_path.path()); |
| 301 break; | 301 break; |
| 302 default: | 302 default: |
| 303 NOTREACHED(); | 303 NOTREACHED(); |
| 304 break; | 304 break; |
| 305 } | 305 } |
| 306 return file_path; | 306 return file_path; |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace content | 309 } // namespace content |
| OLD | NEW |