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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 if (!net::HttpUtil::IsValidHeaderValue(value)) { | 2292 if (!net::HttpUtil::IsValidHeaderValue(value)) { |
2293 OnError(event_name, sub_event_name, request_id, std::move(response)); | 2293 OnError(event_name, sub_event_name, request_id, std::move(response)); |
2294 return RespondNow(Error(keys::kInvalidHeaderValue, name)); | 2294 return RespondNow(Error(keys::kInvalidHeaderValue, name)); |
2295 } | 2295 } |
2296 if (has_request_headers) | 2296 if (has_request_headers) |
2297 request_headers->SetHeader(name, value); | 2297 request_headers->SetHeader(name, value); |
2298 else | 2298 else |
2299 response_headers->push_back(helpers::ResponseHeader(name, value)); | 2299 response_headers->push_back(helpers::ResponseHeader(name, value)); |
2300 } | 2300 } |
2301 if (has_request_headers) | 2301 if (has_request_headers) |
2302 response->request_headers.reset(request_headers.release()); | 2302 response->request_headers = std::move(request_headers); |
2303 else | 2303 else |
2304 response->response_headers.reset(response_headers.release()); | 2304 response->response_headers = std::move(response_headers); |
2305 } | 2305 } |
2306 | 2306 |
2307 if (value->HasKey(keys::kAuthCredentialsKey)) { | 2307 if (value->HasKey(keys::kAuthCredentialsKey)) { |
2308 base::DictionaryValue* credentials_value = NULL; | 2308 base::DictionaryValue* credentials_value = NULL; |
2309 EXTENSION_FUNCTION_VALIDATE(value->GetDictionary( | 2309 EXTENSION_FUNCTION_VALIDATE(value->GetDictionary( |
2310 keys::kAuthCredentialsKey, | 2310 keys::kAuthCredentialsKey, |
2311 &credentials_value)); | 2311 &credentials_value)); |
2312 base::string16 username; | 2312 base::string16 username; |
2313 base::string16 password; | 2313 base::string16 password; |
2314 EXTENSION_FUNCTION_VALIDATE( | 2314 EXTENSION_FUNCTION_VALIDATE( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 // Since EventListeners are segmented by browser_context, check that | 2390 // Since EventListeners are segmented by browser_context, check that |
2391 // last, as it is exceedingly unlikely to be different. | 2391 // last, as it is exceedingly unlikely to be different. |
2392 return extension_id == that.extension_id && | 2392 return extension_id == that.extension_id && |
2393 sub_event_name == that.sub_event_name && | 2393 sub_event_name == that.sub_event_name && |
2394 web_view_instance_id == that.web_view_instance_id && | 2394 web_view_instance_id == that.web_view_instance_id && |
2395 embedder_process_id == that.embedder_process_id && | 2395 embedder_process_id == that.embedder_process_id && |
2396 browser_context == that.browser_context; | 2396 browser_context == that.browser_context; |
2397 } | 2397 } |
2398 | 2398 |
2399 } // namespace extensions | 2399 } // namespace extensions |
OLD | NEW |