commit | aee5c031a69ebb58dffc6618244c0cb8efbcbb39 | [log] [tgz] |
---|---|---|
author | Daniel Cheng <[email protected]> | Thu Apr 18 23:49:05 2019 |
committer | Commit Bot <[email protected]> | Thu Apr 18 23:49:05 2019 |
tree | c1937e7f1bd3cf00aa90330433a01c408b8012eb | |
parent | 1f6b18a3be54418f10eb7b0222507c797521d726 [diff] [blame] |
Make content::ResourceType an enum class. This allows us to be more explicit when content::ResourceType needs to be smuggled in an untyped int. It has the effect of introducing more static_cast<int>, but this makes the conversion sites explicit. This also allows several other incidental fixes: - the Mojo version of the enum no longer defines a sentinel value (which violates best practices in the security guidelines) - the C++ version of the enum can now define a compiler-enforced kMaxValue enumerator. - Since kMaxValue is no longer a distinct value, dummy handling for this value can be removed. This revealed a quirk in chrome/browser/predictors/loading_data_collector.cc Tbr: [email protected] Tbr: [email protected] Tbr: [email protected] Tbr: [email protected] Change-Id: I7203a029b1fcb06426c957d208e9278a25d4a45b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1569345 Commit-Queue: Daniel Cheng <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Tom Sepez <[email protected]> Reviewed-by: Matt Menke <[email protected]> Cr-Commit-Position: refs/heads/master@{#652395}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index c319c1a..1491bf58 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4498,7 +4498,7 @@ top_frame_origin); } else { scoped_refptr<net::URLRequestContextGetter> request_context( - resource_type == RESOURCE_TYPE_MEDIA + resource_type == ResourceType::kMedia ? partition->GetMediaURLRequestContext() : partition->GetURLRequestContext()); base::PostTaskWithTraits(