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

Issue 2854433002: Combine and make const RequiresValidation() and ConditionalizeRequest().

Created:
3 years, 7 months ago by Randy Smith (Not in Mondays)
Modified:
3 years, 7 months ago
Reviewers:
shivanisha
CC:
cbentzel+watch_chromium.org, chromium-reviews, gavinp+disk_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Combine and make const RequiresValidation() and ConditionalizeRequest(). Also fix implementation of MockNetworkTransaction::GetConnectionAttempts() that was causing a lot of spam in the cache unit tests. BUG=None R=shivanisha@chromium.org

Patch Set 1 #

Patch Set 2 : Got all tests running. #

Patch Set 3 : Restructure code, execute todos, fix GetConnectionAttempts. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -94 lines) Patch
M net/http/http_cache_transaction.h View 1 2 4 chunks +19 lines, -10 lines 2 comments Download
M net/http/http_cache_transaction.cc View 1 2 9 chunks +103 lines, -83 lines 5 comments Download
M net/http/http_transaction_test_util.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 9 (7 generated)
Randy Smith (Not in Mondays)
Shivani: PTAL? This is a pure refactor, so in theory shouldn't require any test changes ...
3 years, 7 months ago (2017-04-28 19:42:30 UTC) #4
shivanisha
3 years, 7 months ago (2017-05-02 16:03:26 UTC) #9
https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
File net/http/http_cache_transaction.cc (right):

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.cc:2150: couldnt_conditionalize_request_ = true;
Can we save entry_validation_status as a member variable and then we do not need
to have an additional couldnt_conditionalize_request_?

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.cc:2178: &last_modified_value);
The above two conditions seem to be getting executed twice, once in
GetEntryValidationStatus and then here? It should be only here, so that all
settings in response_ and custom_request_ are done in the same place for
REQUIRES_VALIDATION* cases.

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.cc:2180: 
DCHECK(!etag_value.empty() || !last_modified_value.empty());
to emphasize one of these are non empty to be in this code path.

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.cc:2394: return REQUIRES_REFETCH;
In the original code, this check comes after the original RequiresValidation().
Is it possible that the other REQUIRES_REFETCH conditions, specifically those
checking response_code and fail_conditionalization_for_test_ are also checked
before we invoke RequiresValidation()?

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.cc:2430: : REQUIRES_VALIDATION_VARY_MISMATCH;
Looks like it should be REQUIRES_VALIDATION_VARY_MISMATCH if vary_mismatch is
true?

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
File net/http/http_cache_transaction.h (right):

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.h:252: REQUIRES_REFETCH                    //
Entry needs to be fetched.
nit: prefer enum class for type safety.

https://codereview.chromium.org/2854433002/diff/40001/net/http/http_cache_tra...
net/http/http_cache_transaction.h:439: void RecordHistograms();
Request: Can RecordHistograms be made const as well? (Not related to your
change, but since this CL is making change to histogram related fields)

Powered by Google App Engine
This is Rietveld 408576698