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

Side by Side Diff: trunk/src/third_party/leveldatabase/env_chromium.cc

Issue 14824006: Revert 198820 "Move FileEnumerator to its own file, do some refa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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) 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"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/files/file_enumerator.h"
14 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
15 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
16 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
17 #include "base/message_loop.h" 16 #include "base/message_loop.h"
18 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
19 #include "base/platform_file.h" 18 #include "base/platform_file.h"
20 #include "base/posix/eintr_wrapper.h" 19 #include "base/posix/eintr_wrapper.h"
21 #include "base/stringprintf.h" 20 #include "base/stringprintf.h"
22 #include "base/synchronization/lock.h" 21 #include "base/synchronization/lock.h"
23 #include "base/sys_info.h" 22 #include "base/sys_info.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 447 }
449 } 448 }
450 449
451 virtual bool FileExists(const std::string& fname) { 450 virtual bool FileExists(const std::string& fname) {
452 return ::file_util::PathExists(CreateFilePath(fname)); 451 return ::file_util::PathExists(CreateFilePath(fname));
453 } 452 }
454 453
455 virtual Status GetChildren(const std::string& dir, 454 virtual Status GetChildren(const std::string& dir,
456 std::vector<std::string>* result) { 455 std::vector<std::string>* result) {
457 result->clear(); 456 result->clear();
458 base::FileEnumerator iter( 457 ::file_util::FileEnumerator iter(
459 CreateFilePath(dir), false, base::FileEnumerator::FILES); 458 CreateFilePath(dir), false, ::file_util::FileEnumerator::FILES);
460 base::FilePath current = iter.Next(); 459 base::FilePath current = iter.Next();
461 while (!current.empty()) { 460 while (!current.empty()) {
462 result->push_back(FilePathToString(current.BaseName())); 461 result->push_back(FilePathToString(current.BaseName()));
463 current = iter.Next(); 462 current = iter.Next();
464 } 463 }
465 // TODO(jorlow): Unfortunately, the FileEnumerator swallows errors, so 464 // TODO(jorlow): Unfortunately, the FileEnumerator swallows errors, so
466 // we'll always return OK. Maybe manually check for error 465 // we'll always return OK. Maybe manually check for error
467 // conditions like the file not existing? 466 // conditions like the file not existing?
468 return Status::OK(); 467 return Status::OK();
469 } 468 }
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 825
827 Env* IDBEnv() { 826 Env* IDBEnv() {
828 return idb_env.Pointer(); 827 return idb_env.Pointer();
829 } 828 }
830 829
831 Env* Env::Default() { 830 Env* Env::Default() {
832 return default_env.Pointer(); 831 return default_env.Pointer();
833 } 832 }
834 833
835 } 834 }
OLDNEW
« no previous file with comments | « trunk/src/remoting/host/policy_hack/policy_watcher_linux.cc ('k') | trunk/src/third_party/zlib/google/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698