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

Unified Diff: components/history/core/browser/url_database.cc

Issue 1143183002: Proof of concept implementation of context based history filtering. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « components/history/core/browser/url_database.h ('k') | components/history/core/browser/url_row.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/url_database.cc
diff --git a/components/history/core/browser/url_database.cc b/components/history/core/browser/url_database.cc
index 65ac67e8e9717e9a5f8511b7fd3d7d0e2b5e4a95..024bea27b3a8a1f1e4e940c8241b660a6c08cafc 100644
--- a/components/history/core/browser/url_database.cc
+++ b/components/history/core/browser/url_database.cc
@@ -68,7 +68,8 @@ void URLDatabase::FillURLRow(sql::Statement& s, URLRow* i) {
i->visit_count_ = s.ColumnInt(3);
i->typed_count_ = s.ColumnInt(4);
i->last_visit_ = base::Time::FromInternalValue(s.ColumnInt64(5));
- i->hidden_ = s.ColumnInt(6) != 0;
+ i->context_ = static_cast<history::HistoryContext>(s.ColumnInt(6));
+ i->hidden_ = s.ColumnInt(7) != 0;
}
bool URLDatabase::GetURLRow(URLID url_id, URLRow* info) {
@@ -115,15 +116,16 @@ URLID URLDatabase::GetRowForURL(const GURL& url, URLRow* info) {
bool URLDatabase::UpdateURLRow(URLID url_id, const URLRow& info) {
sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
- "UPDATE urls SET title=?,visit_count=?,typed_count=?,last_visit_time=?,"
+ "UPDATE urls SET title=?,visit_count=?,typed_count=?,last_visit_time=?,context=?,"
"hidden=?"
"WHERE id=?"));
statement.BindString16(0, info.title());
statement.BindInt(1, info.visit_count());
statement.BindInt(2, info.typed_count());
statement.BindInt64(3, info.last_visit().ToInternalValue());
- statement.BindInt(4, info.hidden() ? 1 : 0);
- statement.BindInt64(5, url_id);
+ statement.BindInt(4, info.context());
+ statement.BindInt(5, info.hidden() ? 1 : 0);
+ statement.BindInt64(6, url_id);
return statement.Run() && GetDB().GetLastChangeCount() > 0;
}
@@ -603,6 +605,7 @@ bool URLDatabase::CreateURLTable(bool is_temporary) {
"visit_count INTEGER DEFAULT 0 NOT NULL,"
"typed_count INTEGER DEFAULT 0 NOT NULL,"
"last_visit_time INTEGER NOT NULL,"
+ "context INTEGER DEFAULT 0 NOT NULL,"
"hidden INTEGER DEFAULT 0 NOT NULL,"
"favicon_id INTEGER DEFAULT 0 NOT NULL)"); // favicon_id is not used now.
« no previous file with comments | « components/history/core/browser/url_database.h ('k') | components/history/core/browser/url_row.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698