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

Unified Diff: chrome/browser/resources/google_now/utility.js

Issue 38323003: Add authorization to crash reports (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: chrome/browser/resources/google_now/utility.js
diff --git a/chrome/browser/resources/google_now/utility.js b/chrome/browser/resources/google_now/utility.js
index 418b6f3098d3e81e8fbfbdd80a4b7a8e218d6507..a72dd1a582a7900cb973714427e0fdc8313d23b0 100644
--- a/chrome/browser/resources/google_now/utility.js
+++ b/chrome/browser/resources/google_now/utility.js
@@ -141,7 +141,13 @@ function sendErrorReport(error) {
request.onloadend = function(event) {
console.log('sendErrorReport status: ' + request.status);
};
- request.send(JSON.stringify(errorObject));
+
+ chrome.identity.getAuthToken({interactive: false}, function(token) {
+ if (token) {
+ request.setRequestHeader('Authorization', 'Bearer ' + token);
robliao 2013/10/23 22:24:15 setAuthorization reusuable here?
vadimt 2013/10/23 22:32:23 Nope, since it does stuff that we don't need here
+ request.send(JSON.stringify(errorObject));
+ }
+ });
}
// Limiting 1 error report per background page load.
« 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