DescriptionWebRequest API cleanup
Cleanup changes:
- Moved the event dictionary generation logic to a new class
(WebRequestEventDetails), to deduplicate logic and make it easier to
manipulate the event details.
- Remove some unused aliases, forward-declarations and includes.
- Fixed a few typos.
- Moved ExtraInfoSpec to web_request_api_helpers.
- Remove ExtractRequestInfoDetails.
- Solved TODOs from https://codereview.chromium.org/1413853005/
- Avoid unnecessary copying of event details (request body and headers,
response headers). Previously these dictionaries were always copied
and removed later, which is wasteful.
Visible changes:
- When a request has no response headers, the status code defaults to
-1 (from URLRequestJob) instead of a dummy value of 200. This affects
the webRequest.onResponseStarted and webRequest.onCompleted events for
file: and ftp: requests. The new behavior is consistent with the
webRequest.onBeforeRedirect event (which also reports -1 for unknown
statuses).
- requestBody is only included if set in extraInfoSpec (bug 542719).
BUG=432875, 542719
TEST=./browser_tests --gtest_filter=ExtensionWebRequestApiTest.*
./unit_tests --gtest_filter=ExtensionWebRequestTest.*
Committed: https://crrev.com/3eb7a397449be2eda5f8ad5ad4436ad8377563c6
Cr-Commit-Position: refs/heads/master@{#368979}
Patch Set 1 : #Patch Set 2 : copy GetSocketAddress().host instead of & to resolve win failure #
Total comments: 3
Messages
Total messages: 19 (8 generated)
|