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

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: Fixing unit tests 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 | chrome/browser/resources/google_now/utility_unittest.gtestjs » ('j') | 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 bfcb6ed076fdc3892b2b13433265944ef5ce702a..5960636aeb4eaad422972eb482d44eb5491902c8 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);
+ request.send(JSON.stringify(errorObject));
+ }
+ });
}
// Limiting 1 error report per background page load.
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/utility_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698