Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Issue 1577673002: WebRequest API cleanup (Closed)

Created:
4 years, 11 months ago by robwu
Modified:
4 years, 11 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebRequest 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+606 lines, -456 lines) Patch
M chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.h View 2 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api_unittest.cc View 8 chunks +94 lines, -25 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.h View 4 chunks +10 lines, -29 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.cc View 28 chunks +102 lines, -387 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api_helpers.h View 1 chunk +15 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api_helpers.cc View 1 chunk +27 lines, -0 lines 0 comments Download
A extensions/browser/api/web_request/web_request_event_details.h View 1 chunk +144 lines, -0 lines 3 comments Download
A extensions/browser/api/web_request/web_request_event_details.cc View 1 1 chunk +199 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_event_router_delegate.h View 3 chunks +6 lines, -4 lines 0 comments Download
M extensions/browser/api/web_request/web_request_event_router_delegate.cc View 2 chunks +2 lines, -1 line 0 comments Download
M extensions/extensions.gypi View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (8 generated)
robwu
Hi Dominic, PTAL. Here is a brief overview of diff (see CL description for more ...
4 years, 11 months ago (2016-01-11 00:00:55 UTC) #4
battre
LGTM, nice! https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h File extensions/browser/api/web_request/web_request_event_details.h (right): https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h#newcode78 extensions/browser/api/web_request/web_request_event_details.h:78: void SetBoolean(const std::string& key, bool value) { ...
4 years, 11 months ago (2016-01-12 13:08:03 UTC) #5
robwu
https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h File extensions/browser/api/web_request/web_request_event_details.h (right): https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h#newcode78 extensions/browser/api/web_request/web_request_event_details.h:78: void SetBoolean(const std::string& key, bool value) { On 2016/01/12 ...
4 years, 11 months ago (2016-01-12 16:33:05 UTC) #6
battre
https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h File extensions/browser/api/web_request/web_request_event_details.h (right): https://codereview.chromium.org/1577673002/diff/60001/extensions/browser/api/web_request/web_request_event_details.h#newcode78 extensions/browser/api/web_request/web_request_event_details.h:78: void SetBoolean(const std::string& key, bool value) { On 2016/01/12 ...
4 years, 11 months ago (2016-01-12 19:05:21 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1577673002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1577673002/60001
4 years, 11 months ago (2016-01-12 19:57:11 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/134656)
4 years, 11 months ago (2016-01-12 20:06:59 UTC) #11
robwu
Ken, can you give a rubber stamp for extensions/browser?
4 years, 11 months ago (2016-01-12 20:10:10 UTC) #13
Ken Rockot(use gerrit already)
rs lgtm
4 years, 11 months ago (2016-01-12 20:12:46 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1577673002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1577673002/60001
4 years, 11 months ago (2016-01-12 20:14:46 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:60001)
4 years, 11 months ago (2016-01-12 20:48:47 UTC) #17
commit-bot: I haz the power
4 years, 11 months ago (2016-01-12 20:50:01 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/3eb7a397449be2eda5f8ad5ad4436ad8377563c6
Cr-Commit-Position: refs/heads/master@{#368979}

Powered by Google App Engine
This is Rietveld 408576698