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

Unified Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 980543002: Adding statusCode for webRequest onHeadersReceived and onAuthRequired callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: extensions/browser/api/web_request/web_request_api.cc
diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc
index 0e036a6f40d3d865daeef7db11988e5d6502b5b9..7de492e0e56134752d61132d4674c55f18c6c4e7 100644
--- a/extensions/browser/api/web_request/web_request_api.cc
+++ b/extensions/browser/api/web_request/web_request_api.cc
@@ -889,6 +889,8 @@ int ExtensionWebRequestEventRouter::OnHeadersReceived(
ExtractRequestInfo(request, dict);
dict->SetString(keys::kStatusLineKey,
original_response_headers->GetStatusLine());
+ dict->SetInteger(keys::kStatusCodeKey,
+ original_response_headers->response_code());
if (extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS) {
dict->Set(keys::kResponseHeadersKey,
GetResponseHeadersList(original_response_headers));
@@ -960,6 +962,8 @@ ExtensionWebRequestEventRouter::OnAuthRequired(
challenger->SetInteger(keys::kPortKey, auth_info.challenger.port());
dict->Set(keys::kChallengerKey, challenger);
dict->Set(keys::kStatusLineKey, GetStatusLine(request->response_headers()));
+ dict->SetInteger(keys::kStatusCodeKey,
+ request->response_headers()->response_code());
if (extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS) {
dict->Set(keys::kResponseHeadersKey,
GetResponseHeadersList(request->response_headers()));
« no previous file with comments | « chrome/test/data/extensions/api_test/webrequest/test_simple.js ('k') | extensions/common/api/web_request.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698