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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java

Issue 2180113003: Make sure the Async test cases availabel today generate correct ClientID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
index c65885e46b5e83f9b0ad66dc81dd60ec13b3a17f..c02f0c4624a83bbab8f949026ebd4cf862b6d4a0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
@@ -26,7 +26,7 @@ import org.chromium.ui.base.PageTransition;
import java.net.URI;
import java.util.Locale;
-import java.util.Random;
+import java.util.UUID;
/**
* A default {@link ContextMenuItemDelegate} that supports the context menu functionality in Tab.
@@ -170,9 +170,9 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
@Override
public void onSavePageLater(String linkUrl) {
OfflinePageBridge bridge = OfflinePageBridge.getForProfile(mTab.getProfile());
- Random random = new Random();
- long offline_id = random.nextLong();
- ClientId clientId = new ClientId("async_loading", Long.toString(offline_id));
+ // Download UI needs "async_loading" namespace and a type 4 (random) GUID.
chili 2016/07/27 18:40:47 nit: can we leave out the 'type 4' in the comments
Dmitry Titov 2016/07/27 19:50:49 Done.
+ String uuid = UUID.randomUUID().toString();
+ ClientId clientId = new ClientId("async_loading", uuid);
bridge.savePageLater(linkUrl, clientId);
}
« no previous file with comments | « no previous file | chrome/browser/ui/webui/offline_internals_ui.cc » ('j') | chrome/browser/ui/webui/offline_internals_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698