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

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 2961723003: [USS] Implement ApplySyncChanges and OnURLVisited/Modified/Deleted. (Closed)
Patch Set: handle nullptr case in bridge Created 3 years, 5 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
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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 db_->GetVisitsSource(visits, sources); 1035 db_->GetVisitsSource(visits, sources);
1036 return true; 1036 return true;
1037 } 1037 }
1038 1038
1039 bool HistoryBackend::GetURL(const GURL& url, URLRow* url_row) { 1039 bool HistoryBackend::GetURL(const GURL& url, URLRow* url_row) {
1040 if (db_) 1040 if (db_)
1041 return db_->GetRowForURL(url, url_row) != 0; 1041 return db_->GetRowForURL(url, url_row) != 0;
1042 return false; 1042 return false;
1043 } 1043 }
1044 1044
1045 bool HistoryBackend::GetURLByID(URLID url_id, URLRow* url_row) {
1046 if (db_)
1047 return db_->GetURLRow(url_id, url_row);
1048 return false;
1049 }
1050
1045 void HistoryBackend::QueryURL(const GURL& url, 1051 void HistoryBackend::QueryURL(const GURL& url,
1046 bool want_visits, 1052 bool want_visits,
1047 QueryURLResult* result) { 1053 QueryURLResult* result) {
1048 DCHECK(result); 1054 DCHECK(result);
1049 result->success = db_ && db_->GetRowForURL(url, &result->row); 1055 result->success = db_ && db_->GetRowForURL(url, &result->row);
1050 // Optionally query the visits. 1056 // Optionally query the visits.
1051 if (result->success && want_visits) 1057 if (result->success && want_visits)
1052 db_->GetVisitsForURL(result->row.id(), &result->visits); 1058 db_->GetVisitsForURL(result->row.id(), &result->visits);
1053 } 1059 }
1054 1060
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 // transaction is currently open. 2659 // transaction is currently open.
2654 db_->CommitTransaction(); 2660 db_->CommitTransaction();
2655 db_->Vacuum(); 2661 db_->Vacuum();
2656 db_->BeginTransaction(); 2662 db_->BeginTransaction();
2657 db_->GetStartDate(&first_recorded_time_); 2663 db_->GetStartDate(&first_recorded_time_);
2658 2664
2659 return true; 2665 return true;
2660 } 2666 }
2661 2667
2662 } // namespace history 2668 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/history_backend.h ('k') | components/history/core/browser/typed_url_sync_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698