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

Side by Side Diff: chrome/browser/autocomplete/network_action_predictor_database.cc

Issue 10171014: Changed to Reset(bool clear_bound_vars) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac build error. Created 8 years, 8 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 | chrome/browser/history/text_database.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 "chrome/browser/autocomplete/network_action_predictor_database.h" 5 #include "chrome/browser/autocomplete/network_action_predictor_database.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/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 sql::Statement statement(db_.GetUniqueStatement(base::StringPrintf( 198 sql::Statement statement(db_.GetUniqueStatement(base::StringPrintf(
199 "DELETE FROM %s WHERE id=?", 199 "DELETE FROM %s WHERE id=?",
200 kNetworkActionPredictorTableName).c_str())); 200 kNetworkActionPredictorTableName).c_str()));
201 201
202 db_.BeginTransaction(); 202 db_.BeginTransaction();
203 for (std::vector<Row::Id>::const_iterator it = id_list.begin(); 203 for (std::vector<Row::Id>::const_iterator it = id_list.begin();
204 it != id_list.end(); ++it) { 204 it != id_list.end(); ++it) {
205 statement.BindString(0, *it); 205 statement.BindString(0, *it);
206 statement.Run(); 206 statement.Run();
207 statement.Reset(); 207 statement.Reset(true);
208 } 208 }
209 db_.CommitTransaction(); 209 db_.CommitTransaction();
210 } 210 }
211 211
212 void NetworkActionPredictorDatabase::DeleteAllRows() { 212 void NetworkActionPredictorDatabase::DeleteAllRows() {
213 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB)); 213 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB));
214 214
215 if (canceled_.IsSet()) 215 if (canceled_.IsSet())
216 return; 216 return;
217 217
(...skipping 30 matching lines...) Expand all
248 bool success = db_.Execute(base::StringPrintf( 248 bool success = db_.Execute(base::StringPrintf(
249 "CREATE TABLE %s ( " 249 "CREATE TABLE %s ( "
250 "id TEXT PRIMARY KEY, " 250 "id TEXT PRIMARY KEY, "
251 "user_text TEXT, " 251 "user_text TEXT, "
252 "url TEXT, " 252 "url TEXT, "
253 "number_of_hits INTEGER, " 253 "number_of_hits INTEGER, "
254 "number_of_misses INTEGER)", kNetworkActionPredictorTableName).c_str()); 254 "number_of_misses INTEGER)", kNetworkActionPredictorTableName).c_str());
255 DCHECK(success) << "Failed to create " << kNetworkActionPredictorTableName 255 DCHECK(success) << "Failed to create " << kNetworkActionPredictorTableName
256 << " table."; 256 << " table.";
257 } 257 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/text_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698