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

Side by Side Diff: base/file_util_posix.cc

Issue 3052023: Remove some debug switches. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rebase. Created 10 years, 4 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
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <fnmatch.h> 10 #include <fnmatch.h>
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (!dtemp) { 423 if (!dtemp) {
424 DPLOG(ERROR) << "mkdtemp"; 424 DPLOG(ERROR) << "mkdtemp";
425 return false; 425 return false;
426 } 426 }
427 *new_dir = FilePath(dtemp); 427 *new_dir = FilePath(dtemp);
428 return true; 428 return true;
429 } 429 }
430 430
431 bool CreateTemporaryDirInDir(const FilePath& base_dir, 431 bool CreateTemporaryDirInDir(const FilePath& base_dir,
432 const FilePath::StringType& prefix, 432 const FilePath::StringType& prefix,
433 bool loosen_permissions,
434 FilePath* new_dir) { 433 FilePath* new_dir) {
435 // To understand crbug/35198, the ability to call this
436 // this function on windows while giving loose permissions
437 // to the resulting directory has been temporarily added.
438 // It should not be possible to call this function with
439 // loosen_permissions == true on non-windows platforms.
440 DCHECK(!loosen_permissions);
441
442 FilePath::StringType mkdtemp_template = prefix; 434 FilePath::StringType mkdtemp_template = prefix;
443 mkdtemp_template.append(FILE_PATH_LITERAL("XXXXXX")); 435 mkdtemp_template.append(FILE_PATH_LITERAL("XXXXXX"));
444 return CreateTemporaryDirInDirImpl(base_dir, mkdtemp_template, new_dir); 436 return CreateTemporaryDirInDirImpl(base_dir, mkdtemp_template, new_dir);
445 } 437 }
446 438
447 bool CreateNewTempDirectory(const FilePath::StringType& prefix, 439 bool CreateNewTempDirectory(const FilePath::StringType& prefix,
448 FilePath* new_temp_path) { 440 FilePath* new_temp_path) {
449 FilePath tmpdir; 441 FilePath tmpdir;
450 if (!GetTempDir(&tmpdir)) 442 if (!GetTempDir(&tmpdir))
451 return false; 443 return false;
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 if (HANDLE_EINTR(close(infile)) < 0) 833 if (HANDLE_EINTR(close(infile)) < 0)
842 result = false; 834 result = false;
843 if (HANDLE_EINTR(close(outfile)) < 0) 835 if (HANDLE_EINTR(close(outfile)) < 0)
844 result = false; 836 result = false;
845 837
846 return result; 838 return result;
847 } 839 }
848 #endif // defined(OS_MACOSX) 840 #endif // defined(OS_MACOSX)
849 841
850 } // namespace file_util 842 } // namespace file_util
OLDNEW
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698