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

Side by Side Diff: chrome/browser/chromeos/drive/resource_metadata_storage.cc

Issue 18286004: Move PathExists to 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/drive/resource_metadata_storage.h" 5 #include "chrome/browser/chromeos/drive/resource_metadata_storage.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/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 const base::FilePath resource_map_path = 224 const base::FilePath resource_map_path =
225 directory_path_.Append(kResourceMapDBName); 225 directory_path_.Append(kResourceMapDBName);
226 226
227 // Try to open the existing DB. 227 // Try to open the existing DB.
228 leveldb::DB* db = NULL; 228 leveldb::DB* db = NULL;
229 leveldb::Options options; 229 leveldb::Options options;
230 options.create_if_missing = false; 230 options.create_if_missing = false;
231 231
232 DBInitStatus open_existing_result = DB_INIT_NOT_FOUND; 232 DBInitStatus open_existing_result = DB_INIT_NOT_FOUND;
233 if (file_util::PathExists(resource_map_path)) { 233 if (base::PathExists(resource_map_path)) {
234 leveldb::Status status = 234 leveldb::Status status =
235 leveldb::DB::Open(options, resource_map_path.AsUTF8Unsafe(), &db); 235 leveldb::DB::Open(options, resource_map_path.AsUTF8Unsafe(), &db);
236 open_existing_result = LevelDBStatusToDBInitStatus(status); 236 open_existing_result = LevelDBStatusToDBInitStatus(status);
237 } 237 }
238 238
239 if (open_existing_result == DB_INIT_SUCCESS) { 239 if (open_existing_result == DB_INIT_SUCCESS) {
240 resource_map_.reset(db); 240 resource_map_.reset(db);
241 241
242 // Check the validity of existing DB. 242 // Check the validity of existing DB.
243 ResourceMetadataHeader header; 243 ResourceMetadataHeader header;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (!it->status().ok() || num_child_entries != num_entries_with_parent) { 608 if (!it->status().ok() || num_child_entries != num_entries_with_parent) {
609 DLOG(ERROR) << "Error during checking resource map. status = " 609 DLOG(ERROR) << "Error during checking resource map. status = "
610 << it->status().ToString(); 610 << it->status().ToString();
611 return false; 611 return false;
612 } 612 }
613 return true; 613 return true;
614 } 614 }
615 615
616 } // namespace internal 616 } // namespace internal
617 } // namespace drive 617 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_util_unittest.cc ('k') | chrome/browser/chromeos/enterprise_extension_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698