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

Side by Side Diff: sql/connection.cc

Issue 16866008: Rewrite scoped_ptr<T>(NULL) to use the default ctor in sql/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 Connection::Connection() 117 Connection::Connection()
118 : db_(NULL), 118 : db_(NULL),
119 page_size_(0), 119 page_size_(0),
120 cache_size_(0), 120 cache_size_(0),
121 exclusive_locking_(false), 121 exclusive_locking_(false),
122 transaction_nesting_(0), 122 transaction_nesting_(0),
123 needs_rollback_(false), 123 needs_rollback_(false),
124 in_memory_(false), 124 in_memory_(false),
125 poisoned_(false), 125 poisoned_(false) {}
126 error_delegate_(NULL) {
127 }
128 126
129 Connection::~Connection() { 127 Connection::~Connection() {
130 Close(); 128 Close();
131 } 129 }
132 130
133 bool Connection::Open(const base::FilePath& path) { 131 bool Connection::Open(const base::FilePath& path) {
134 if (!histogram_tag_.empty()) { 132 if (!histogram_tag_.empty()) {
135 int64 size_64 = 0; 133 int64 size_64 = 0;
136 if (file_util::GetFileSize(path, &size_64)) { 134 if (file_util::GetFileSize(path, &size_64)) {
137 size_t sample = static_cast<size_t>(size_64 / 1024); 135 size_t sample = static_cast<size_t>(size_64 / 1024);
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 } 801 }
804 802
805 // Best effort to put things back as they were before. 803 // Best effort to put things back as they were before.
806 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF"; 804 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF";
807 ignore_result(Execute(kNoWritableSchema)); 805 ignore_result(Execute(kNoWritableSchema));
808 806
809 return ret; 807 return ret;
810 } 808 }
811 809
812 } // namespace sql 810 } // namespace sql
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698