| Index: chrome/browser/extensions/extension_webrequest_api_helpers.h
|
| diff --git a/chrome/browser/extensions/extension_webrequest_api_helpers.h b/chrome/browser/extensions/extension_webrequest_api_helpers.h
|
| index a10390f227f4225059be5f6e9f446ea31dfb9391..e3cf503f33d4476af0ffb77b99405d05aba1e77c 100644
|
| --- a/chrome/browser/extensions/extension_webrequest_api_helpers.h
|
| +++ b/chrome/browser/extensions/extension_webrequest_api_helpers.h
|
| @@ -29,6 +29,9 @@ class Value;
|
|
|
| namespace extension_webrequest_api_helpers {
|
|
|
| +typedef std::pair<std::string, std::string> ResponseHeader;
|
| +typedef std::vector<ResponseHeader> ResponseHeaders;
|
| +
|
| // Contains the modification an extension wants to perform on an event.
|
| struct EventResponseDelta {
|
| // ID of the extension that sent this response.
|
| @@ -49,8 +52,12 @@ struct EventResponseDelta {
|
| // Keys of request headers to be deleted.
|
| std::vector<std::string> deleted_request_headers;
|
|
|
| - // Complete set of response headers that will replace the original ones.
|
| - scoped_refptr<net::HttpResponseHeaders> new_response_headers;
|
| + // Headers that were added in the response. A modification of a header
|
| + // corresponds to a deletion and subsequenst addition of the new header.
|
| + ResponseHeaders added_response_headers;
|
| +
|
| + // Headers that were deleted in the response.
|
| + ResponseHeaders deleted_response_headers;
|
|
|
| // Authentication Credentials to use.
|
| scoped_ptr<net::AuthCredentials> auth_credentials;
|
| @@ -110,16 +117,12 @@ EventResponseDelta* CalculateOnBeforeSendHeadersDelta(
|
| bool cancel,
|
| net::HttpRequestHeaders* old_headers,
|
| net::HttpRequestHeaders* new_headers);
|
| -// |status_line| contains the status line of the original request. Together
|
| -// with |response_headers_string| we can assemble a complete new response
|
| -// header. |response_headers_string| contains all headers with \n as line
|
| -// separator. It terminates with two \n.
|
| EventResponseDelta* CalculateOnHeadersReceivedDelta(
|
| const std::string& extension_id,
|
| const base::Time& extension_install_time,
|
| bool cancel,
|
| - const std::string& status_line,
|
| - const std::string& response_headers_string);
|
| + net::HttpResponseHeaders* old_response_headers,
|
| + ResponseHeaders* new_response_headers);
|
| // Destructively moves the auth credentials from |auth_credentials| to the
|
| // returned EventResponseDelta.
|
| EventResponseDelta* CalculateOnAuthRequiredDelta(
|
| @@ -156,7 +159,6 @@ void MergeOnBeforeSendHeadersResponses(
|
| EventLogEntries* event_log_entries);
|
| // Overrides |override_response_headers| with the response headers returned
|
| // by the extension with the highest precedence.
|
| -// TODO(battre) Implement merging of response header modifications.
|
| void MergeOnHeadersReceivedResponses(
|
| const EventResponseDeltas& deltas,
|
| scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
|
|
|