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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return PP_OK; | 238 return PP_OK; |
239 } | 239 } |
240 | 240 |
241 int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( | 241 int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( |
242 ppapi::host::HostMessageContext* context) { | 242 ppapi::host::HostMessageContext* context) { |
243 ppapi::PepperFilePath dir_path( | 243 ppapi::PepperFilePath dir_path( |
244 ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, base::FilePath()); | 244 ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL, base::FilePath()); |
245 base::FilePath validated_dir_path = ValidateAndConvertPepperFilePath( | 245 base::FilePath validated_dir_path = ValidateAndConvertPepperFilePath( |
246 dir_path, kReadPermissions | kWritePermissions); | 246 dir_path, kReadPermissions | kWritePermissions); |
247 if (validated_dir_path.empty() || | 247 if (validated_dir_path.empty() || |
248 (!file_util::DirectoryExists(validated_dir_path) && | 248 (!base::DirectoryExists(validated_dir_path) && |
249 !file_util::CreateDirectory(validated_dir_path))) { | 249 !file_util::CreateDirectory(validated_dir_path))) { |
250 return ppapi::PlatformFileErrorToPepperError( | 250 return ppapi::PlatformFileErrorToPepperError( |
251 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); | 251 base::PLATFORM_FILE_ERROR_ACCESS_DENIED); |
252 } | 252 } |
253 | 253 |
254 base::FilePath file_path; | 254 base::FilePath file_path; |
255 if (!file_util::CreateTemporaryFileInDir(validated_dir_path, &file_path)) { | 255 if (!file_util::CreateTemporaryFileInDir(validated_dir_path, &file_path)) { |
256 return ppapi::PlatformFileErrorToPepperError( | 256 return ppapi::PlatformFileErrorToPepperError( |
257 base::PLATFORM_FILE_ERROR_FAILED); | 257 base::PLATFORM_FILE_ERROR_FAILED); |
258 } | 258 } |
(...skipping 41 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 |