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

Unified Diff: chrome/browser/push_messaging/push_messaging_app_identifier.cc

Issue 1906723003: Unify UUID/GUID generation code across base and blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ASSERT, use StringPiece Created 4 years, 8 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/push_messaging/push_messaging_app_identifier.cc
diff --git a/chrome/browser/push_messaging/push_messaging_app_identifier.cc b/chrome/browser/push_messaging/push_messaging_app_identifier.cc
index d4f7e7063188aadd5c5ab6cedf9ebfeba8b1cc0b..812f00bf8961dcd47428250ea620cf5ae0290fa1 100644
--- a/chrome/browser/push_messaging/push_messaging_app_identifier.cc
+++ b/chrome/browser/push_messaging/push_messaging_app_identifier.cc
@@ -66,7 +66,9 @@ void PushMessagingAppIdentifier::RegisterProfilePrefs(
PushMessagingAppIdentifier PushMessagingAppIdentifier::Generate(
const GURL& origin,
int64_t service_worker_registration_id) {
- std::string guid = base::GenerateGUID();
+ // Use uppercase GUID for consistency with GUIDs Push has already sent to GCM.
+ // Also allows detecting case mangling; see code commented "crbug.com/461867".
+ std::string guid = base::ToUpperASCII(base::GenerateGUID());
CHECK(!guid.empty());
std::string app_id =
kPushMessagingAppIdentifierPrefix + origin.spec() + kSeparator + guid;

Powered by Google App Engine
This is Rietveld 408576698