diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 21:08:38 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 21:08:38 +0000 |
commit | b78f94325babe6b0e01812ffef36b57aeb45bfa7 (patch) | |
tree | 00bb3eeaf412ae836a3d397e56d37790f87ce500 /chrome/browser/history/url_database.cc | |
parent | 37539c7dafc27daba389bee4d0d2e137aae5f91e (diff) | |
download | chromium_src-b78f94325babe6b0e01812ffef36b57aeb45bfa7.zip chromium_src-b78f94325babe6b0e01812ffef36b57aeb45bfa7.tar.gz chromium_src-b78f94325babe6b0e01812ffef36b57aeb45bfa7.tar.bz2 |
Makes the in memory db update rows that have search terms associated
with them.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6135001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/url_database.cc')
-rw-r--r-- | chrome/browser/history/url_database.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index 3f297bd..dd3346b 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); |