Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_unittest.cc ('k') | content/renderer/gpu/gpu_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698