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

Side by Side Diff: sql/connection.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
« no previous file with comments | « net/url_request/url_fetcher_impl_unittest.cc ('k') | sql/connection_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) 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 "sql/connection.h" 5 #include "sql/connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 bool Connection::Delete(const base::FilePath& path) { 395 bool Connection::Delete(const base::FilePath& path) {
396 base::ThreadRestrictions::AssertIOAllowed(); 396 base::ThreadRestrictions::AssertIOAllowed();
397 397
398 base::FilePath journal_path(path.value() + FILE_PATH_LITERAL("-journal")); 398 base::FilePath journal_path(path.value() + FILE_PATH_LITERAL("-journal"));
399 base::FilePath wal_path(path.value() + FILE_PATH_LITERAL("-wal")); 399 base::FilePath wal_path(path.value() + FILE_PATH_LITERAL("-wal"));
400 400
401 base::Delete(journal_path, false); 401 base::Delete(journal_path, false);
402 base::Delete(wal_path, false); 402 base::Delete(wal_path, false);
403 base::Delete(path, false); 403 base::Delete(path, false);
404 404
405 return !file_util::PathExists(journal_path) && 405 return !base::PathExists(journal_path) &&
406 !file_util::PathExists(wal_path) && 406 !base::PathExists(wal_path) &&
407 !file_util::PathExists(path); 407 !base::PathExists(path);
408 } 408 }
409 409
410 bool Connection::BeginTransaction() { 410 bool Connection::BeginTransaction() {
411 if (needs_rollback_) { 411 if (needs_rollback_) {
412 DCHECK_GT(transaction_nesting_, 0); 412 DCHECK_GT(transaction_nesting_, 0);
413 413
414 // When we're going to rollback, fail on this begin and don't actually 414 // When we're going to rollback, fail on this begin and don't actually
415 // mark us as entering the nested transaction. 415 // mark us as entering the nested transaction.
416 return false; 416 return false;
417 } 417 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 // Best effort to put things back as they were before. 853 // Best effort to put things back as they were before.
854 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF"; 854 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF";
855 ignore_result(Execute(kNoWritableSchema)); 855 ignore_result(Execute(kNoWritableSchema));
856 856
857 return ret; 857 return ret;
858 } 858 }
859 859
860 } // namespace sql 860 } // namespace sql
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_impl_unittest.cc ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698