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

Side by Side Diff: third_party/leveldatabase/env_chromium.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
« no previous file with comments | « remoting/host/setup/daemon_controller_linux.cc ('k') | third_party/zlib/google/zip.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) 2011 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include <errno.h> 5 #include <errno.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 file = ::base::CreatePlatformFile( 702 file = ::base::CreatePlatformFile(
703 CreateFilePath(fname), flags, &created, &error_code); 703 CreateFilePath(fname), flags, &created, &error_code);
704 } while (error_code != ::base::PLATFORM_FILE_OK && 704 } while (error_code != ::base::PLATFORM_FILE_OK &&
705 retrier.ShouldKeepTrying(error_code)); 705 retrier.ShouldKeepTrying(error_code));
706 706
707 if (error_code == ::base::PLATFORM_FILE_ERROR_NOT_FOUND) { 707 if (error_code == ::base::PLATFORM_FILE_ERROR_NOT_FOUND) {
708 ::base::FilePath parent = CreateFilePath(fname).DirName(); 708 ::base::FilePath parent = CreateFilePath(fname).DirName();
709 ::base::FilePath last_parent; 709 ::base::FilePath last_parent;
710 int num_missing_ancestors = 0; 710 int num_missing_ancestors = 0;
711 do { 711 do {
712 if (file_util::DirectoryExists(parent)) 712 if (base::DirectoryExists(parent))
713 break; 713 break;
714 ++num_missing_ancestors; 714 ++num_missing_ancestors;
715 last_parent = parent; 715 last_parent = parent;
716 parent = parent.DirName(); 716 parent = parent.DirName();
717 } while (parent != last_parent); 717 } while (parent != last_parent);
718 RecordLockFileAncestors(num_missing_ancestors); 718 RecordLockFileAncestors(num_missing_ancestors);
719 } 719 }
720 720
721 if (error_code != ::base::PLATFORM_FILE_OK) { 721 if (error_code != ::base::PLATFORM_FILE_OK) {
722 result = MakeIOError( 722 result = MakeIOError(
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 Env* IDBEnv() { 957 Env* IDBEnv() {
958 return leveldb_env::idb_env.Pointer(); 958 return leveldb_env::idb_env.Pointer();
959 } 959 }
960 960
961 Env* Env::Default() { 961 Env* Env::Default() {
962 return leveldb_env::default_env.Pointer(); 962 return leveldb_env::default_env.Pointer();
963 } 963 }
964 964
965 } // namespace leveldb 965 } // namespace leveldb
966 966
OLDNEW
« no previous file with comments | « remoting/host/setup/daemon_controller_linux.cc ('k') | third_party/zlib/google/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698