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

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: updated per CR comments 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/offline_internals_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2f4984d479e5ea3f9ce89ff9dabbc7627083e89b 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 random (type 4) GUID.
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698