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

Unified Diff: components/history/core/browser/web_history_service.cc

Issue 1016483006: Hotword: Only run the Audio History callback with 'success' if there is a valid response (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/web_history_service.cc
diff --git a/components/history/core/browser/web_history_service.cc b/components/history/core/browser/web_history_service.cc
index b4e953eb235b3db370bca37185d8ef4373f00d17..91b498c9474ec0bc662364e175057f0ae913586e 100644
--- a/components/history/core/browser/web_history_service.cc
+++ b/components/history/core/browser/web_history_service.cc
@@ -477,7 +477,11 @@ void WebHistoryService::AudioHistoryCompletionCallback(
if (response_value)
response_value->GetBoolean("history_recording_enabled", &enabled_value);
}
- callback.Run(success, enabled_value);
+
+ // If there is no response_value, then for our purposes, the request has
+ // failed, despite receiving a true |success| value. This can happen if
+ // the user is offline.
+ callback.Run(success && response_value, enabled_value);
}
} // namespace history
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698