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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils.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: chrome/browser/android/offline_pages/offline_page_utils.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc
index 5fdaa58dc70b62369bd81c17c06306a6516c58c2..a2595778044a5efa3df262f05d5e16dae2f5e8b4 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/android/offline_pages/offline_page_utils.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
@@ -103,7 +104,15 @@ int64_t OfflinePageUtils::GetBookmarkIdForOfflineURL(
if (!offline_page)
return -1;
- return offline_page->bookmark_id;
+ if (offline_page->client_id.name_space != offline_pages::BOOKMARK_NAMESPACE) {
+ return -1;
+ }
+
+ int64_t result;
+ if (base::StringToInt64(offline_page->client_id.id, &result)) {
+ return result;
+ }
+ return -1;
}
// static

Powered by Google App Engine
This is Rietveld 408576698