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

Unified Diff: components/offline_pages/offline_page_test_store.cc

Issue 1694863003: Refactor the offline page storage to include client namespace and id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address changes Created 4 years, 10 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: components/offline_pages/offline_page_test_store.cc
diff --git a/components/offline_pages/offline_page_test_store.cc b/components/offline_pages/offline_page_test_store.cc
index 186a0b922bfff6af8b3dc6dd6fe0fa3036ab1a8f..dcfc1c07b64f1eea763ee2e13240e7694a8e52b3 100644
--- a/components/offline_pages/offline_page_test_store.cc
+++ b/components/offline_pages/offline_page_test_store.cc
@@ -40,19 +40,19 @@ void OfflinePageTestStore::AddOrUpdateOfflinePage(
last_saved_page_ = offline_page;
bool result = scenario_ != TestScenario::WRITE_FAILED;
if (result)
- offline_pages_[offline_page.bookmark_id] = offline_page;
+ offline_pages_[offline_page.offline_id] = offline_page;
if (!callback.is_null())
task_runner_->PostTask(FROM_HERE, base::Bind(callback, result));
}
void OfflinePageTestStore::RemoveOfflinePages(
- const std::vector<int64_t>& bookmark_ids,
+ const std::vector<int64_t>& offline_ids,
const UpdateCallback& callback) {
- ASSERT_FALSE(bookmark_ids.empty());
+ ASSERT_FALSE(offline_ids.empty());
bool result = false;
if (scenario_ != TestScenario::REMOVE_FAILED) {
- for (const auto& bookmark_id : bookmark_ids) {
- auto iter = offline_pages_.find(bookmark_id);
+ for (const auto& offline_id : offline_ids) {
+ auto iter = offline_pages_.find(offline_id);
if (iter != offline_pages_.end()) {
offline_pages_.erase(iter);
result = true;
@@ -69,9 +69,9 @@ void OfflinePageTestStore::Reset(const ResetCallback& callback) {
}
void OfflinePageTestStore::UpdateLastAccessTime(
- int64_t bookmark_id,
+ int64_t offline_id,
const base::Time& last_access_time) {
- auto iter = offline_pages_.find(bookmark_id);
+ auto iter = offline_pages_.find(offline_id);
if (iter == offline_pages_.end())
return;
iter->second.last_access_time = last_access_time;

Powered by Google App Engine
This is Rietveld 408576698