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

Unified Diff: chrome/browser/extensions/api/music_manager_private/device_id.cc

Issue 81683002: Prevent GetDeviceId from invoking its callback multiple times in failure cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +TODO Created 7 years, 1 month 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/prefs/pref_metrics_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/music_manager_private/device_id.cc
diff --git a/chrome/browser/extensions/api/music_manager_private/device_id.cc b/chrome/browser/extensions/api/music_manager_private/device_id.cc
index e405030172dd8bfdec465bf8a9d725660dc62433..df453bd17115125481911cf43eabed17276ab073 100644
--- a/chrome/browser/extensions/api/music_manager_private/device_id.cc
+++ b/chrome/browser/extensions/api/music_manager_private/device_id.cc
@@ -35,17 +35,19 @@ void GetMachineIdCallback(const std::string& extension_id,
if (machine_id.empty()) {
callback.Run("");
+ return;
}
std::string device_id;
if (!ComputeHmacSha256(machine_id, extension_id, &device_id)) {
DLOG(ERROR) << "Error while computing HMAC-SHA256 of device id.";
callback.Run("");
+ return;
}
callback.Run(device_id);
}
-}
+} // namespace
namespace extensions {
namespace api {
« no previous file with comments | « no previous file | chrome/browser/prefs/pref_metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698