OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/api/web_request/web_request_api.h" | 5 #include "extensions/browser/api/web_request/web_request_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
990 dict->SetBoolean(keys::kIsProxyKey, auth_info.is_proxy); | 990 dict->SetBoolean(keys::kIsProxyKey, auth_info.is_proxy); |
991 if (!auth_info.scheme.empty()) | 991 if (!auth_info.scheme.empty()) |
992 dict->SetString(keys::kSchemeKey, auth_info.scheme); | 992 dict->SetString(keys::kSchemeKey, auth_info.scheme); |
993 if (!auth_info.realm.empty()) | 993 if (!auth_info.realm.empty()) |
994 dict->SetString(keys::kRealmKey, auth_info.realm); | 994 dict->SetString(keys::kRealmKey, auth_info.realm); |
995 base::DictionaryValue* challenger = new base::DictionaryValue(); | 995 base::DictionaryValue* challenger = new base::DictionaryValue(); |
996 challenger->SetString(keys::kHostKey, auth_info.challenger.host()); | 996 challenger->SetString(keys::kHostKey, auth_info.challenger.host()); |
997 challenger->SetInteger(keys::kPortKey, auth_info.challenger.port()); | 997 challenger->SetInteger(keys::kPortKey, auth_info.challenger.port()); |
998 dict->Set(keys::kChallengerKey, challenger); | 998 dict->Set(keys::kChallengerKey, challenger); |
999 dict->Set(keys::kStatusLineKey, GetStatusLine(request->response_headers())); | 999 dict->Set(keys::kStatusLineKey, GetStatusLine(request->response_headers())); |
1000 dict->SetInteger(keys::kStatusCodeKey, | 1000 if (request->response_headers()) |
1001 dict->SetInteger(keys::kStatusCodeKey, | |
1001 request->response_headers()->response_code()); | 1002 request->response_headers()->response_code()); |
not at google - send to devlin
2015/08/19 14:43:25
Make sure to run "git cl format" before submitting
shiva.jm
2015/08/20 04:07:37
Done.
| |
1002 if (extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS) { | 1003 if (extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS) { |
1003 dict->Set(keys::kResponseHeadersKey, | 1004 dict->Set(keys::kResponseHeadersKey, |
1004 GetResponseHeadersList(request->response_headers())); | 1005 GetResponseHeadersList(request->response_headers())); |
1005 } | 1006 } |
1006 args.Append(dict); | 1007 args.Append(dict); |
1007 | 1008 |
1008 if (DispatchEvent(browser_context, request, listeners, args)) { | 1009 if (DispatchEvent(browser_context, request, listeners, args)) { |
1009 blocked_requests_[request->identifier()].event = kOnAuthRequired; | 1010 blocked_requests_[request->identifier()].event = kOnAuthRequired; |
1010 blocked_requests_[request->identifier()].is_incognito |= | 1011 blocked_requests_[request->identifier()].is_incognito |= |
1011 IsIncognitoBrowserContext(browser_context); | 1012 IsIncognitoBrowserContext(browser_context); |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2496 // Continue gracefully. | 2497 // Continue gracefully. |
2497 RunSync(); | 2498 RunSync(); |
2498 } | 2499 } |
2499 | 2500 |
2500 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { | 2501 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { |
2501 helpers::ClearCacheOnNavigation(); | 2502 helpers::ClearCacheOnNavigation(); |
2502 return true; | 2503 return true; |
2503 } | 2504 } |
2504 | 2505 |
2505 } // namespace extensions | 2506 } // namespace extensions |
OLD | NEW |