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

Side by Side Diff: chrome/browser/history/in_memory_database.cc

Issue 223026: Coverity: Initialize statement_cache_ in the constructor.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/history/in_memory_database.h" 5 #include "chrome/browser/history/in_memory_database.h"
6 6
7 #include "base/histogram.h" 7 #include "base/histogram.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 11
12 namespace history { 12 namespace history {
13 13
14 InMemoryDatabase::InMemoryDatabase() : URLDatabase(), db_(NULL) { 14 InMemoryDatabase::InMemoryDatabase()
15 : URLDatabase(),
16 db_(NULL),
17 statement_cache_(NULL) {
15 } 18 }
16 19
17 InMemoryDatabase::~InMemoryDatabase() { 20 InMemoryDatabase::~InMemoryDatabase() {
18 } 21 }
19 22
20 bool InMemoryDatabase::InitDB() { 23 bool InMemoryDatabase::InitDB() {
21 DCHECK(!db_) << "Already initialized!"; 24 DCHECK(!db_) << "Already initialized!";
22 if (sqlite3_open(":memory:", &db_) != SQLITE_OK) { 25 if (sqlite3_open(":memory:", &db_) != SQLITE_OK) {
23 NOTREACHED() << "Cannot open memory database"; 26 NOTREACHED() << "Cannot open memory database";
24 return false; 27 return false;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 103
101 sqlite3* InMemoryDatabase::GetDB() { 104 sqlite3* InMemoryDatabase::GetDB() {
102 return db_; 105 return db_;
103 } 106 }
104 107
105 SqliteStatementCache& InMemoryDatabase::GetStatementCache() { 108 SqliteStatementCache& InMemoryDatabase::GetStatementCache() {
106 return *statement_cache_; 109 return *statement_cache_;
107 } 110 }
108 111
109 } // namespace history 112 } // namespace history
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