content: ResourceType cleanup.
0) Converted the ResourceType::Type enum to ResourceType enum in content namespace, like this:
enum ResourceType {
RESOURCE_TYPE_MAIN_FRAME = 0, //...
RESOURCE_TYPE_SUB_FRAME, // ...
RESOURCE_TYPE_STYLESHEET, // ...
.
.
.
};
1) FromWebURLRequest() is is only called from within content (child & renderer), moved into
content/child/web_url_request_util.* and renamed to WebURLRequestToResourceType().
2) ValidType/FromInt/IsSubresource aren't called from anywhere. Removed.
3) IsSharedWorker/IsServiceWorker are not necessary, they're just
an enum
comparison and are only called in 5 places. Removed them and
just the if check directly.
-IsFrame is called in a number of places. Leave it
in this header as a function. Since it's not scoped in a class
anymore,
it needs a more descriptive name. Renamed to IsResourceTypeFrame().
BUG=None
TEST=None
[email protected]
TBR=darin@chromium # trivial changes all around src/
Review URL: https://codereview.chromium.org/425653002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286665 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5e8942bc..b7634a4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2612,7 +2612,7 @@
const std::string& security_info,
const std::string& http_method,
const std::string& mime_type,
- ResourceType::Type resource_type) {
+ ResourceType resource_type) {
base::StatsCounter cache("WebKit.CacheHit");
cache.Increment();
@@ -2637,7 +2637,7 @@
if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
scoped_refptr<net::URLRequestContextGetter> request_context(
- resource_type == ResourceType::MEDIA ?
+ resource_type == RESOURCE_TYPE_MEDIA ?
GetBrowserContext()->GetMediaRequestContextForRenderProcess(
GetRenderProcessHost()->GetID()) :
GetBrowserContext()->GetRequestContextForRenderProcess(