| 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 // Helper classes and functions used for the WebRequest API. | 5 // Helper classes and functions used for the WebRequest API. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBREQUEST_WEBREQUEST_API_HELPERS_H_ | 7 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 8 #define CHROME_BROWSER_EXTENSIONS_API_WEBREQUEST_WEBREQUEST_API_HELPERS_H_ | 8 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/auth.h" | 20 #include "net/base/auth.h" |
| 21 #include "net/base/net_log.h" | 21 #include "net/base/net_log.h" |
| 22 #include "net/http/http_request_headers.h" | 22 #include "net/http/http_request_headers.h" |
| 23 #include "net/http/http_response_headers.h" | 23 #include "net/http/http_response_headers.h" |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class ListValue; | 26 class ListValue; |
| 27 class Value; | 27 class Value; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace extension_webrequest_api_helpers { | 30 namespace extension_web_request_api_helpers { |
| 31 | 31 |
| 32 typedef std::pair<std::string, std::string> ResponseHeader; | 32 typedef std::pair<std::string, std::string> ResponseHeader; |
| 33 typedef std::vector<ResponseHeader> ResponseHeaders; | 33 typedef std::vector<ResponseHeader> ResponseHeaders; |
| 34 | 34 |
| 35 // Contains the modification an extension wants to perform on an event. | 35 // Contains the modification an extension wants to perform on an event. |
| 36 struct EventResponseDelta { | 36 struct EventResponseDelta { |
| 37 // ID of the extension that sent this response. | 37 // ID of the extension that sent this response. |
| 38 std::string extension_id; | 38 std::string extension_id; |
| 39 | 39 |
| 40 // The time that the extension was installed. Used for deciding order of | 40 // The time that the extension was installed. Used for deciding order of |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // if any, will have its authentication credentials used. |request| must be | 171 // if any, will have its authentication credentials used. |request| must be |
| 172 // non-NULL, and contain |deltas| that are sorted in decreasing order of | 172 // non-NULL, and contain |deltas| that are sorted in decreasing order of |
| 173 // precedence. | 173 // precedence. |
| 174 // Returns whether authentication credentials are set. | 174 // Returns whether authentication credentials are set. |
| 175 bool MergeOnAuthRequiredResponses( | 175 bool MergeOnAuthRequiredResponses( |
| 176 const EventResponseDeltas& deltas, | 176 const EventResponseDeltas& deltas, |
| 177 net::AuthCredentials* auth_credentials, | 177 net::AuthCredentials* auth_credentials, |
| 178 std::set<std::string>* conflicting_extensions, | 178 std::set<std::string>* conflicting_extensions, |
| 179 EventLogEntries* event_log_entries); | 179 EventLogEntries* event_log_entries); |
| 180 | 180 |
| 181 } // namespace extension_webrequest_api_helpers | 181 } // namespace extension_web_request_api_helpers |
| 182 | 182 |
| 183 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBREQUEST_WEBREQUEST_API_HELPERS_H_ | 183 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| OLD | NEW |