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

Unified Diff: chrome/browser/history/url_database.cc

Issue 6135001: Makes the in memory db update rows that have search terms associated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comments and forward declare Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/url_database.cc
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc
index 3f297bdbce4f68ea3f7cfb078eb7ac8a4932b0a6..dd3346b8c893d1df203c241e2576e49c99175bda 100644
--- a/chrome/browser/history/url_database.cc
+++ b/chrome/browser/history/url_database.cc
@@ -386,6 +386,26 @@ bool URLDatabase::SetKeywordSearchTermsForURL(URLID url_id,
return statement.Run();
}
+bool URLDatabase::GetKeywordSearchTermRow(URLID url_id,
+ KeywordSearchTermRow* row) {
+ DCHECK(url_id);
+ sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
+ "SELECT keyword_id, term FROM keyword_search_terms WHERE url_id=?"));
+ if (!statement)
+ return false;
+
+ statement.BindInt64(0, url_id);
+ if (!statement.Step())
+ return false;
+
+ if (row) {
+ row->url_id = url_id;
+ row->keyword_id = statement.ColumnInt64(0);
+ row->term = statement.ColumnString16(1);
+ }
+ return true;
+}
+
void URLDatabase::DeleteAllSearchTermsForKeyword(
TemplateURLID keyword_id) {
DCHECK(keyword_id);

Powered by Google App Engine
This is Rietveld 408576698