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/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc
index db04dad..2e3c95a 100644
--- a/content/browser/appcache/appcache_host.cc
+++ b/content/browser/appcache/appcache_host.cc
@@ -285,7 +285,7 @@
 
 AppCacheRequestHandler* AppCacheHost::CreateRequestHandler(
     net::URLRequest* request,
-    ResourceType::Type resource_type) {
+    ResourceType resource_type) {
   if (is_for_dedicated_worker()) {
     AppCacheHost* parent_host = GetParentAppCacheHost();
     if (parent_host)
diff --git a/content/browser/appcache/appcache_host.h b/content/browser/appcache/appcache_host.h
index 2201c8c..7a63d35c 100644
--- a/content/browser/appcache/appcache_host.h
+++ b/content/browser/appcache/appcache_host.h
@@ -110,7 +110,8 @@
   // Support for loading resources out of the appcache.
   // May return NULL if the request isn't subject to retrieval from an appache.
   AppCacheRequestHandler* CreateRequestHandler(
-      net::URLRequest* request, ResourceType::Type resource_type);
+      net::URLRequest* request,
+      ResourceType resource_type);
 
   // Support for devtools inspecting appcache resources.
   void GetResourceList(std::vector<AppCacheResourceInfo>* resource_infos);
diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc
index 76c5c0d3..3385e54 100644
--- a/content/browser/appcache/appcache_interceptor.cc
+++ b/content/browser/appcache/appcache_interceptor.cc
@@ -18,8 +18,8 @@
   return Singleton<AppCacheInterceptor>::get();
 }
 
-void AppCacheInterceptor::SetHandler(
-    net::URLRequest* request, AppCacheRequestHandler* handler) {
+void AppCacheInterceptor::SetHandler(net::URLRequest* request,
+                                     AppCacheRequestHandler* handler) {
   request->SetUserData(GetInstance(), handler);  // request takes ownership
 }
 
@@ -30,8 +30,11 @@
 }
 
 void AppCacheInterceptor::SetExtraRequestInfo(
-    net::URLRequest* request, AppCacheServiceImpl* service, int process_id,
-    int host_id, ResourceType::Type resource_type) {
+    net::URLRequest* request,
+    AppCacheServiceImpl* service,
+    int process_id,
+    int host_id,
+    ResourceType resource_type) {
   if (!service || (host_id == kAppCacheNoHostId))
     return;
 
diff --git a/content/browser/appcache/appcache_interceptor.h b/content/browser/appcache/appcache_interceptor.h
index cbfcb24..b584919 100644
--- a/content/browser/appcache/appcache_interceptor.h
+++ b/content/browser/appcache/appcache_interceptor.h
@@ -31,7 +31,7 @@
                                   AppCacheServiceImpl* service,
                                   int process_id,
                                   int host_id,
-                                  ResourceType::Type resource_type);
+                                  ResourceType resource_type);
 
   // May be called after response headers are complete to retrieve extra
   // info about the response.
diff --git a/content/browser/appcache/appcache_request_handler.cc b/content/browser/appcache/appcache_request_handler.cc
index 2db7a52..7987a990 100644
--- a/content/browser/appcache/appcache_request_handler.cc
+++ b/content/browser/appcache/appcache_request_handler.cc
@@ -13,12 +13,16 @@
 
 namespace content {
 
-AppCacheRequestHandler::AppCacheRequestHandler(
-    AppCacheHost* host, ResourceType::Type resource_type)
-    : host_(host), resource_type_(resource_type),
-      is_waiting_for_cache_selection_(false), found_group_id_(0),
-      found_cache_id_(0), found_network_namespace_(false),
-      cache_entry_not_found_(false), maybe_load_resource_executed_(false) {
+AppCacheRequestHandler::AppCacheRequestHandler(AppCacheHost* host,
+                                               ResourceType resource_type)
+    : host_(host),
+      resource_type_(resource_type),
+      is_waiting_for_cache_selection_(false),
+      found_group_id_(0),
+      found_cache_id_(0),
+      found_network_namespace_(false),
+      cache_entry_not_found_(false),
+      maybe_load_resource_executed_(false) {
   DCHECK(host_);
   host_->AddObserver(this);
 }
@@ -210,7 +214,7 @@
   DCHECK(host_ && job_.get() && job_->is_waiting());
   DCHECK(entry.has_response_id());
 
-  if (ResourceType::IsFrame(resource_type_) && !namespace_entry_url.is_empty())
+  if (IsResourceTypeFrame(resource_type_) && !namespace_entry_url.is_empty())
     host_->NotifyMainResourceIsNamespaceEntry(namespace_entry_url);
 
   job_->DeliverAppCachedResponse(manifest_url, group_id, cache_id,
@@ -235,8 +239,8 @@
   DCHECK(host_);
 
   const AppCacheHost* spawning_host =
-      ResourceType::IsSharedWorker(resource_type_) ?
-          host_ : host_->GetSpawningHost();
+      (resource_type_ == RESOURCE_TYPE_SHARED_WORKER) ?
+      host_ : host_->GetSpawningHost();
   GURL preferred_manifest_url = spawning_host ?
       spawning_host->preferred_manifest_url() : GURL();
 
@@ -267,17 +271,17 @@
       !policy->CanLoadAppCache(manifest_url, host_->first_party_url());
 
   if (was_blocked_by_policy) {
-    if (ResourceType::IsFrame(resource_type_)) {
+    if (IsResourceTypeFrame(resource_type_)) {
       host_->NotifyMainResourceBlocked(manifest_url);
     } else {
-      DCHECK(ResourceType::IsSharedWorker(resource_type_));
+      DCHECK_EQ(resource_type_, RESOURCE_TYPE_SHARED_WORKER);
       host_->frontend()->OnContentBlocked(host_->host_id(), manifest_url);
     }
     DeliverNetworkResponse();
     return;
   }
 
-  if (ResourceType::IsFrame(resource_type_) && cache_id != kAppCacheNoCacheId) {
+  if (IsResourceTypeFrame(resource_type_) && cache_id != kAppCacheNoCacheId) {
     // AppCacheHost loads and holds a reference to the main resource cache
     // for two reasons, firstly to preload the cache into the working set
     // in advance of subresource loads happening, secondly to prevent the
diff --git a/content/browser/appcache/appcache_request_handler.h b/content/browser/appcache/appcache_request_handler.h
index d851685..4ff72a3 100644
--- a/content/browser/appcache/appcache_request_handler.h
+++ b/content/browser/appcache/appcache_request_handler.h
@@ -50,16 +50,16 @@
   void PrepareForCrossSiteTransfer(int old_process_id);
   void CompleteCrossSiteTransfer(int new_process_id, int new_host_id);
 
-  static bool IsMainResourceType(ResourceType::Type type) {
-    return ResourceType::IsFrame(type) ||
-           ResourceType::IsSharedWorker(type);
+  static bool IsMainResourceType(ResourceType type) {
+    return IsResourceTypeFrame(type) ||
+           type == RESOURCE_TYPE_SHARED_WORKER;
   }
 
  private:
   friend class AppCacheHost;
 
   // Callers should use AppCacheHost::CreateRequestHandler.
-  AppCacheRequestHandler(AppCacheHost* host, ResourceType::Type resource_type);
+  AppCacheRequestHandler(AppCacheHost* host, ResourceType resource_type);
 
   // AppCacheHost::Observer override
   virtual void OnDestructionImminent(AppCacheHost* host) OVERRIDE;
@@ -108,7 +108,7 @@
   AppCacheHost* host_;
 
   // Frame vs subresource vs sharedworker loads are somewhat different.
-  ResourceType::Type resource_type_;
+  ResourceType resource_type_;
 
   // Subresource requests wait until after cache selection completes.
   bool is_waiting_for_cache_selection_;
diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc
index e8cc8f6..6376a0f 100644
--- a/content/browser/appcache/appcache_request_handler_unittest.cc
+++ b/content/browser/appcache/appcache_request_handler_unittest.cc
@@ -265,7 +265,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     job_ = handler_->MaybeLoadResource(request_.get(),
@@ -312,7 +312,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     mock_storage()->SimulateFindMainResource(
@@ -360,7 +360,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     mock_storage()->SimulateFindMainResource(
@@ -442,7 +442,7 @@
     request_.reset(new MockURLRequest(GURL("http://blah/fallback-override"),
                                       &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     mock_storage()->SimulateFindMainResource(
@@ -494,7 +494,7 @@
   void SubResource_Miss_WithNoCacheSelected() {
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
 
     // We avoid creating handler when possible, sub-resource requests are not
     // subject to retrieval from an appcache when there's no associated cache.
@@ -512,7 +512,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
 
     job_ = handler_->MaybeLoadResource(request_.get(),
@@ -543,7 +543,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
     job_ = handler_->MaybeLoadResource(request_.get(),
                                        request_->context()->network_delegate());
@@ -577,7 +577,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
     job_ = handler_->MaybeLoadResource(request_.get(),
                                        request_->context()->network_delegate());
@@ -609,7 +609,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
     job_ = handler_->MaybeLoadResource(request_.get(),
                                        request_->context()->network_delegate());
@@ -642,7 +642,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
     job_ = handler_->MaybeLoadResource(request_.get(),
                                        request_->context()->network_delegate());
@@ -676,7 +676,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
     job_ = handler_->MaybeLoadResource(request_.get(),
                                        request_->context()->network_delegate());
@@ -705,7 +705,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
 
     backend_impl_->UnregisterHost(1);
@@ -731,7 +731,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());
 
     job_ = handler_->MaybeLoadResource(request_.get(),
@@ -763,7 +763,7 @@
 
     request_.reset(new MockURLRequest(GURL("ftp://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::SUB_RESOURCE));
+                                               RESOURCE_TYPE_SUB_RESOURCE));
     EXPECT_TRUE(handler_.get());  // we could redirect to http (conceivably)
 
     EXPECT_FALSE(handler_->MaybeLoadResource(
@@ -783,7 +783,7 @@
   void CanceledRequest() {
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     job_ = handler_->MaybeLoadResource(request_.get(),
@@ -809,13 +809,13 @@
 
   void WorkerRequest() {
     EXPECT_TRUE(AppCacheRequestHandler::IsMainResourceType(
-        ResourceType::MAIN_FRAME));
+        RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(AppCacheRequestHandler::IsMainResourceType(
-        ResourceType::SUB_FRAME));
+        RESOURCE_TYPE_SUB_FRAME));
     EXPECT_TRUE(AppCacheRequestHandler::IsMainResourceType(
-        ResourceType::SHARED_WORKER));
+        RESOURCE_TYPE_SHARED_WORKER));
     EXPECT_FALSE(AppCacheRequestHandler::IsMainResourceType(
-        ResourceType::WORKER));
+        RESOURCE_TYPE_WORKER));
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
 
@@ -828,7 +828,7 @@
     AppCacheHost* worker_host = backend_impl_->GetHost(kWorkerHostId);
     worker_host->SelectCacheForWorker(kParentHostId, kMockProcessId);
     handler_.reset(worker_host->CreateRequestHandler(
-        request_.get(), ResourceType::SHARED_WORKER));
+        request_.get(), RESOURCE_TYPE_SHARED_WORKER));
     EXPECT_TRUE(handler_.get());
     // Verify that the handler is associated with the parent host.
     EXPECT_EQ(host_, handler_->host_);
@@ -841,7 +841,7 @@
     EXPECT_EQ(NULL, backend_impl_->GetHost(kNonExsitingHostId));
     worker_host->SelectCacheForWorker(kNonExsitingHostId, kMockProcessId);
     handler_.reset(worker_host->CreateRequestHandler(
-        request_.get(), ResourceType::SHARED_WORKER));
+        request_.get(), RESOURCE_TYPE_SHARED_WORKER));
     EXPECT_FALSE(handler_.get());
 
     TestFinished();
@@ -856,7 +856,7 @@
 
     request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
     handler_.reset(host_->CreateRequestHandler(request_.get(),
-                                               ResourceType::MAIN_FRAME));
+                                               RESOURCE_TYPE_MAIN_FRAME));
     EXPECT_TRUE(handler_.get());
 
     mock_policy_->can_load_return_value_ = false;
diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc
index da3bb56..1c2154e 100644
--- a/content/browser/appcache/appcache_storage_impl_unittest.cc
+++ b/content/browser/appcache/appcache_storage_impl_unittest.cc
@@ -1768,7 +1768,7 @@
       AppCacheInterceptor::SetExtraRequestInfo(
           request_.get(), service_.get(),
           backend_->process_id(), host2->host_id(),
-          ResourceType::MAIN_FRAME);
+          RESOURCE_TYPE_MAIN_FRAME);
       request_->Start();
     }
 
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index 68f4e81f..3f8e216 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -580,14 +580,13 @@
   state->second->RevokeReadRawCookies();
 }
 
-bool ChildProcessSecurityPolicyImpl::CanLoadPage(
-    int child_id,
-    const GURL& url,
-    ResourceType::Type resource_type) {
+bool ChildProcessSecurityPolicyImpl::CanLoadPage(int child_id,
+                                                 const GURL& url,
+                                                 ResourceType resource_type) {
   // If --site-per-process flag is passed, we should enforce
   // stronger security restrictions on page navigation.
   if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
-      ResourceType::IsFrame(resource_type)) {
+      IsResourceTypeFrame(resource_type)) {
     // TODO(nasko): Do the proper check for site-per-process, once
     // out-of-process iframes is ready to go.
     return true;
diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h
index 3cd1dd3..9699215b 100644
--- a/content/browser/child_process_security_policy_impl.h
+++ b/content/browser/child_process_security_policy_impl.h
@@ -140,7 +140,7 @@
   // Only might return false if --site-per-process flag is used.
   bool CanLoadPage(int child_id,
                    const GURL& url,
-                   ResourceType::Type resource_type);
+                   ResourceType resource_type);
 
   // Explicit permissions checks for FileSystemURL specified files.
   bool CanReadFileSystemFile(int child_id, const fileapi::FileSystemURL& url);
diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc
index 9d2d1ccd..05837b5 100644
--- a/content/browser/cross_site_transfer_browsertest.cc
+++ b/content/browser/cross_site_transfer_browsertest.cc
@@ -37,7 +37,7 @@
       net::URLRequest* request,
       ResourceContext* resource_context,
       AppCacheService* appcache_service,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       int child_id,
       int route_id,
       ScopedVector<ResourceThrottle>* throttles) OVERRIDE {
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index 69e831bd2..825fc2f4 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -185,7 +185,7 @@
   HostZoomMap* host_zoom_map =
       GetHostZoomMapForResourceContext(info->GetContext());
 
-  if (info->GetResourceType() == ResourceType::MAIN_FRAME && host_zoom_map) {
+  if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME && host_zoom_map) {
     const GURL& request_url = request()->url();
     info->filter()->Send(new ViewMsg_SetZoomLevelForLoadingURL(
         info->GetRouteID(),
diff --git a/content/browser/loader/cross_site_resource_handler.cc b/content/browser/loader/cross_site_resource_handler.cc
index ad6397a..f8a5e37 100644
--- a/content/browser/loader/cross_site_resource_handler.cc
+++ b/content/browser/loader/cross_site_resource_handler.cc
@@ -134,7 +134,7 @@
     bool* defer) {
   // Top-level requests change their cookie first-party URL on redirects, while
   // subframes retain the parent's value.
-  if (GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME)
+  if (GetRequestInfo()->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME)
     request()->set_first_party_for_cookies(new_url);
 
   // We should not have started the transition before being redirected.
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index b132d953..b72e96a24 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -136,10 +136,10 @@
 // same resource (see bugs 46104 and 31014).
 const int kDefaultDetachableCancelDelayMs = 30000;
 
-bool IsDetachableResourceType(ResourceType::Type type) {
+bool IsDetachableResourceType(ResourceType type) {
   switch (type) {
-    case ResourceType::PREFETCH:
-    case ResourceType::PING:
+    case RESOURCE_TYPE_PREFETCH:
+    case RESOURCE_TYPE_PING:
       return true;
     default:
       return false;
@@ -677,7 +677,7 @@
 
   ResourceRequestInfoImpl* info = loader->GetRequestInfo();
 
-  if (!ResourceType::IsFrame(info->GetResourceType()))
+  if (!IsResourceTypeFrame(info->GetResourceType()))
     return false;
 
   const net::URLRequestJobFactory* job_factory =
@@ -747,7 +747,7 @@
   ResourceRequestInfo* info = loader->GetRequestInfo();
 
   // Record final result of all resource loads.
-  if (info->GetResourceType() == ResourceType::MAIN_FRAME) {
+  if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) {
     // This enumeration has "3" appended to its name to distinguish it from
     // older versions.
     UMA_HISTOGRAM_SPARSE_SLOWLY(
@@ -768,7 +768,7 @@
           "Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts);
     }
   } else {
-    if (info->GetResourceType() == ResourceType::IMAGE) {
+    if (info->GetResourceType() == RESOURCE_TYPE_IMAGE) {
       UMA_HISTOGRAM_SPARSE_SLOWLY(
           "Net.ErrorCodesForImages",
           -loader->request()->status().error());
@@ -1064,7 +1064,7 @@
   }
 
   bool allow_download = request_data.allow_download &&
-      ResourceType::IsFrame(request_data.resource_type);
+      IsResourceTypeFrame(request_data.resource_type);
 
   // Make extra info and read footer (contains request ID).
   ResourceRequestInfoImpl* extra_info =
@@ -1167,12 +1167,12 @@
   // let us check whether a transfer is required and pause for the unload
   // handler either if so or if a cross-process navigation is already under way.
   bool is_swappable_navigation =
-      request_data.resource_type == ResourceType::MAIN_FRAME;
+      request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME;
   // If we are using --site-per-process, install it for subframes as well.
   if (!is_swappable_navigation &&
       CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) {
     is_swappable_navigation =
-        request_data.resource_type == ResourceType::SUB_FRAME;
+        request_data.resource_type == RESOURCE_TYPE_SUB_FRAME;
   }
   if (is_swappable_navigation && process_type == PROCESS_TYPE_RENDERER)
     handler.reset(new CrossSiteResourceHandler(handler.Pass(), request));
@@ -1298,7 +1298,7 @@
       false,     // is_main_frame
       false,     // parent_is_main_frame
       -1,        // parent_render_frame_id
-      ResourceType::SUB_RESOURCE,
+      RESOURCE_TYPE_SUB_RESOURCE,
       PAGE_TRANSITION_LINK,
       false,     // should_replace_current_entry
       download,  // is_download
@@ -1942,15 +1942,15 @@
   // keep-alive connection created to load a sub-frame or a sub-resource could
   // be reused to load a main frame.
   load_flags |= net::LOAD_VERIFY_EV_CERT;
-  if (request_data.resource_type == ResourceType::MAIN_FRAME) {
+  if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) {
     load_flags |= net::LOAD_MAIN_FRAME;
-  } else if (request_data.resource_type == ResourceType::SUB_FRAME) {
+  } else if (request_data.resource_type == RESOURCE_TYPE_SUB_FRAME) {
     load_flags |= net::LOAD_SUB_FRAME;
-  } else if (request_data.resource_type == ResourceType::PREFETCH) {
+  } else if (request_data.resource_type == RESOURCE_TYPE_PREFETCH) {
     load_flags |= (net::LOAD_PREFETCH | net::LOAD_DO_NOT_PROMPT_FOR_LOGIN);
-  } else if (request_data.resource_type == ResourceType::FAVICON) {
+  } else if (request_data.resource_type == RESOURCE_TYPE_FAVICON) {
     load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN;
-  } else if (request_data.resource_type == ResourceType::IMAGE) {
+  } else if (request_data.resource_type == RESOURCE_TYPE_IMAGE) {
     // Prevent third-party image content from prompting for login, as this
     // is often a scam to extract credentials for another domain from the user.
     // Only block image loads, as the attack applies largely to the "src"
@@ -1988,7 +1988,7 @@
 
   // Add a flag to selectively bypass the data reduction proxy if the resource
   // type is not an image.
-  if (request_data.resource_type != ResourceType::IMAGE)
+  if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
     load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
 
   return load_flags;
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 32ef5ed..c798b19 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -125,10 +125,9 @@
   return request_id;
 }
 
-static ResourceHostMsg_Request CreateResourceRequest(
-    const char* method,
-    ResourceType::Type type,
-    const GURL& url) {
+static ResourceHostMsg_Request CreateResourceRequest(const char* method,
+                                                     ResourceType type,
+                                                     const GURL& url) {
   ResourceHostMsg_Request request;
   request.method = std::string(method);
   request.url = url;
@@ -662,7 +661,7 @@
       net::URLRequest* request,
       ResourceContext* resource_context,
       AppCacheService* appcache_service,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       int child_id,
       int route_id,
       ScopedVector<ResourceThrottle>* throttles) OVERRIDE {
@@ -798,9 +797,10 @@
 
   // Generates a request using the given filter and resource type.
   void MakeTestRequestWithResourceType(ResourceMessageFilter* filter,
-                                       int render_view_id, int request_id,
+                                       int render_view_id,
+                                       int request_id,
                                        const GURL& url,
-                                       ResourceType::Type type);
+                                       ResourceType type);
 
   void CancelRequest(int request_id);
   void RendererCancelRequest(int request_id) {
@@ -892,7 +892,7 @@
                                                  int request_id,
                                                  const GURL& url) {
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
-                                  url, ResourceType::SUB_RESOURCE);
+                                  url, RESOURCE_TYPE_SUB_RESOURCE);
 }
 
 void ResourceDispatcherHostTest::MakeTestRequestWithResourceType(
@@ -900,7 +900,7 @@
     int render_view_id,
     int request_id,
     const GURL& url,
-    ResourceType::Type type) {
+    ResourceType type) {
   ResourceHostMsg_Request request =
       CreateResourceRequest("GET", type, url);
   ResourceHostMsg_RequestResource msg(render_view_id, request_id, request);
@@ -1039,7 +1039,7 @@
   MakeTestRequest(0, 3, net::URLRequestTestJob::test_url_3());
   MakeTestRequestWithResourceType(filter_.get(), 0, 4,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
   MakeTestRequest(0, 5, net::URLRequestTestJob::test_url_redirect_to_url_2());
 
   // Finish the redirection
@@ -1073,7 +1073,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), 0, 4,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
   CancelRequest(2);
 
@@ -1124,7 +1124,7 @@
 TEST_F(ResourceDispatcherHostTest, DetachedResourceTimesOut) {
   MakeTestRequestWithResourceType(filter_.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
   GlobalRequestID global_request_id(filter_->child_id(), 1);
   ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(
       host_.GetURLRequest(global_request_id));
@@ -1166,9 +1166,9 @@
 TEST_F(ResourceDispatcherHostTest, DeletedFilterDetached) {
   // test_url_1's data is available synchronously, so use 2 and 3.
   ResourceHostMsg_Request request_prefetch = CreateResourceRequest(
-      "GET", ResourceType::PREFETCH, net::URLRequestTestJob::test_url_2());
+      "GET", RESOURCE_TYPE_PREFETCH, net::URLRequestTestJob::test_url_2());
   ResourceHostMsg_Request request_ping = CreateResourceRequest(
-      "GET", ResourceType::PING, net::URLRequestTestJob::test_url_3());
+      "GET", RESOURCE_TYPE_PING, net::URLRequestTestJob::test_url_3());
 
   ResourceHostMsg_RequestResource msg_prefetch(0, 1, request_prefetch);
   host_.OnMessageReceived(msg_prefetch, filter_);
@@ -1217,7 +1217,7 @@
 // resources should continue to load, even when redirected.
 TEST_F(ResourceDispatcherHostTest, DeletedFilterDetachedRedirect) {
   ResourceHostMsg_Request request = CreateResourceRequest(
-      "GET", ResourceType::PREFETCH,
+      "GET", RESOURCE_TYPE_PREFETCH,
       net::URLRequestTestJob::test_url_redirect_to_url_2());
 
   ResourceHostMsg_RequestResource msg(0, 1, request);
@@ -1297,7 +1297,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
   // Cancel request must come from the renderer for a detachable resource to
   // detach.
   RendererCancelRequest(1);
@@ -1463,11 +1463,11 @@
 
   // request 1 goes to the test delegate
   ResourceHostMsg_Request request = CreateResourceRequest(
-      "GET", ResourceType::SUB_RESOURCE, net::URLRequestTestJob::test_url_1());
+      "GET", RESOURCE_TYPE_SUB_RESOURCE, net::URLRequestTestJob::test_url_1());
 
   MakeTestRequestWithResourceType(test_filter.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
 
   // request 2 goes to us
   MakeTestRequest(0, 2, net::URLRequestTestJob::test_url_2());
@@ -1475,12 +1475,12 @@
   // request 3 goes to the test delegate
   MakeTestRequestWithResourceType(test_filter.get(), 0, 3,
                                   net::URLRequestTestJob::test_url_3(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
 
   // request 4 goes to us
   MakeTestRequestWithResourceType(filter_.get(), 0, 4,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
 
   // Make sure all requests have finished stage one. test_url_1 will have
@@ -1537,7 +1537,7 @@
 TEST_F(ResourceDispatcherHostTest, TestProcessCancelDetachedTimesOut) {
   MakeTestRequestWithResourceType(filter_.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
   GlobalRequestID global_request_id(filter_->child_id(), 1);
   ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(
       host_.GetURLRequest(global_request_id));
@@ -1648,7 +1648,7 @@
   // Blocked detachable resources should not delay cancellation.
   MakeTestRequestWithResourceType(filter_.get(), 1, 5,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
   // Flush all the pending requests.
   while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -1682,19 +1682,19 @@
 
   MakeTestRequestWithResourceType(filter_.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(second_filter.get(), 0, 2,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 0, 3,
                                   net::URLRequestTestJob::test_url_3(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(second_filter.get(), 0, 4,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(second_filter.get(), 0, 5,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
   // Simulate process death.
   host_.CancelRequestsForProcess(second_filter->child_id());
@@ -1730,28 +1730,28 @@
 
   MakeTestRequestWithResourceType(filter_.get(), 0, 1,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 1, 2,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 0, 3,
                                   net::URLRequestTestJob::test_url_3(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(second_filter.get(), 1, 4,
                                   net::URLRequestTestJob::test_url_1(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 2, 5,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 2, 6,
                                   net::URLRequestTestJob::test_url_3(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 0, 7,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
   MakeTestRequestWithResourceType(second_filter.get(), 1, 8,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
   host_.CancelRequestsForProcess(filter_->child_id());
   host_.CancelRequestsForProcess(second_filter->child_id());
@@ -1812,25 +1812,25 @@
   for (size_t i = 0; i < kMaxRequests; ++i) {
     MakeTestRequestWithResourceType(filter_.get(), 0, i + 1,
                                     net::URLRequestTestJob::test_url_2(),
-                                    ResourceType::SUB_RESOURCE);
+                                    RESOURCE_TYPE_SUB_RESOURCE);
   }
 
   // Issue two more requests for our process -- these should fail immediately.
   MakeTestRequestWithResourceType(filter_.get(), 0, kMaxRequests + 1,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(filter_.get(), 0, kMaxRequests + 2,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
 
   // Issue two requests for the second process -- these should succeed since
   // it is just process 0 that is saturated.
   MakeTestRequestWithResourceType(second_filter.get(), 0, kMaxRequests + 3,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
   MakeTestRequestWithResourceType(second_filter.get(), 0, kMaxRequests + 4,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
 
   // Flush all the pending requests.
   while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -1881,25 +1881,25 @@
   for (size_t i = 0; i < kMaxRequestsPerProcess; ++i) {
     MakeTestRequestWithResourceType(filter_.get(), 0, i + 1,
                                     net::URLRequestTestJob::test_url_2(),
-                                    ResourceType::SUB_RESOURCE);
+                                    RESOURCE_TYPE_SUB_RESOURCE);
   }
 
   // Issue another request for our process -- this should fail immediately.
   MakeTestRequestWithResourceType(filter_.get(), 0, kMaxRequestsPerProcess + 1,
                                   net::URLRequestTestJob::test_url_2(),
-                                  ResourceType::SUB_RESOURCE);
+                                  RESOURCE_TYPE_SUB_RESOURCE);
 
   // Issue a request for the second process -- this should succeed, because it
   // is just process 0 that is saturated.
   MakeTestRequestWithResourceType(
       second_filter.get(), 0, kMaxRequestsPerProcess + 2,
-      net::URLRequestTestJob::test_url_2(), ResourceType::SUB_RESOURCE);
+      net::URLRequestTestJob::test_url_2(), RESOURCE_TYPE_SUB_RESOURCE);
 
   // Issue a request for the third process -- this should fail, because the
   // global limit has been reached.
   MakeTestRequestWithResourceType(
       third_filter.get(), 0, kMaxRequestsPerProcess + 3,
-      net::URLRequestTestJob::test_url_2(), ResourceType::SUB_RESOURCE);
+      net::URLRequestTestJob::test_url_2(), RESOURCE_TYPE_SUB_RESOURCE);
 
   // Flush all the pending requests.
   while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -2043,7 +2043,7 @@
 
   // Only MAIN_FRAMEs can trigger a download.
   MakeTestRequestWithResourceType(filter_.get(), 0, 1, GURL("http:bla"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
   // Flush all pending requests.
   while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -2089,7 +2089,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
   // Return some data so that the request is identified as a download
   // and the proper resource handlers are created.
   EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage());
@@ -2124,7 +2124,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
   // Return some data so that the request is identified as a download
   // and the proper resource handlers are created.
   EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage());
@@ -2155,7 +2155,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   net::URLRequestTestJob::test_url_4(),
-                                  ResourceType::PREFETCH);  // detachable type
+                                  RESOURCE_TYPE_PREFETCH);  // detachable type
 
   // Simulate a cancel coming from the renderer.
   RendererCancelRequest(request_id);
@@ -2191,7 +2191,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
 
   GlobalRequestID global_request_id(filter_->child_id(), request_id);
@@ -2240,7 +2240,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
   // Now that we're blocked on the redirect, update the response and unblock by
   // telling the AsyncResourceHandler to follow the redirect.
@@ -2266,7 +2266,7 @@
   int new_request_id = 2;
 
   ResourceHostMsg_Request request =
-      CreateResourceRequest("GET", ResourceType::MAIN_FRAME,
+      CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME,
                             GURL("http://other.com/blech"));
   request.transferred_request_child_id = filter_->child_id();
   request.transferred_request_request_id = request_id;
@@ -2311,7 +2311,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
   // Now that we're blocked on the redirect, update the response and unblock by
   // telling the AsyncResourceHandler to follow the redirect.  Use a text/plain
@@ -2339,7 +2339,7 @@
   int new_request_id = 2;
 
   ResourceHostMsg_Request request =
-      CreateResourceRequest("GET", ResourceType::MAIN_FRAME,
+      CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME,
                             GURL("http://other.com/blech"));
   request.transferred_request_child_id = filter_->child_id();
   request.transferred_request_request_id = request_id;
@@ -2387,7 +2387,7 @@
     first_child_id = first_filter->child_id();
 
     ResourceHostMsg_Request first_request =
-        CreateResourceRequest("GET", ResourceType::MAIN_FRAME,
+        CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME,
                               GURL("http://example.com/blah"));
 
     ResourceHostMsg_RequestResource first_request_msg(
@@ -2423,7 +2423,7 @@
   int new_request_id = 2;
 
   ResourceHostMsg_Request request =
-      CreateResourceRequest("GET", ResourceType::MAIN_FRAME,
+      CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME,
                             GURL("http://other.com/blech"));
   request.transferred_request_child_id = first_child_id;
   request.transferred_request_request_id = request_id;
@@ -2467,7 +2467,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
   // Now that we're blocked on the redirect, simulate hitting another redirect.
   SetResponse("HTTP/1.1 302 Found\n"
@@ -2502,7 +2502,7 @@
   int new_request_id = 2;
 
   ResourceHostMsg_Request request =
-      CreateResourceRequest("GET", ResourceType::MAIN_FRAME,
+      CreateResourceRequest("GET", RESOURCE_TYPE_MAIN_FRAME,
                             GURL("http://other.com/blech"));
   request.transferred_request_child_id = filter_->child_id();
   request.transferred_request_request_id = request_id;
@@ -2540,7 +2540,7 @@
   HandleScheme("http");
 
   MakeTestRequestWithResourceType(filter_.get(), 0, 1, GURL("foo://bar"),
-                                  ResourceType::MAIN_FRAME);
+                                  RESOURCE_TYPE_MAIN_FRAME);
 
   // Flush all pending requests.
   while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -2602,7 +2602,7 @@
 
   MakeTestRequestWithResourceType(filter_.get(), render_view_id, request_id,
                                   GURL("http://example.com/blah"),
-                                  ResourceType::PREFETCH);
+                                  RESOURCE_TYPE_PREFETCH);
 
   // Get a bit of data before cancelling.
   EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage());
@@ -2816,7 +2816,7 @@
 TEST_F(ResourceDispatcherHostTest, DownloadToFile) {
   // Make a request which downloads to file.
   ResourceHostMsg_Request request = CreateResourceRequest(
-      "GET", ResourceType::SUB_RESOURCE, net::URLRequestTestJob::test_url_1());
+      "GET", RESOURCE_TYPE_SUB_RESOURCE, net::URLRequestTestJob::test_url_1());
   request.download_to_file = true;
   ResourceHostMsg_RequestResource request_msg(0, 1, request);
   host_.OnMessageReceived(request_msg, filter_);
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index d4cc9d0..d82cf07 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -165,7 +165,7 @@
 }
 
 void ResourceLoader::MarkAsTransferring() {
-  CHECK(ResourceType::IsFrame(GetRequestInfo()->GetResourceType()))
+  CHECK(IsResourceTypeFrame(GetRequestInfo()->GetResourceType()))
       << "Can only transfer for navigations";
   is_transferring_ = true;
 }
@@ -679,7 +679,7 @@
 void ResourceLoader::RecordHistograms() {
   ResourceRequestInfoImpl* info = GetRequestInfo();
 
-  if (info->GetResourceType() == ResourceType::PREFETCH) {
+  if (info->GetResourceType() == RESOURCE_TYPE_PREFETCH) {
     PrefetchStatus status = STATUS_UNDEFINED;
     TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
 
diff --git a/content/browser/loader/resource_loader_unittest.cc b/content/browser/loader/resource_loader_unittest.cc
index d2fdd99b..047e404f 100644
--- a/content/browser/loader/resource_loader_unittest.cc
+++ b/content/browser/loader/resource_loader_unittest.cc
@@ -319,7 +319,7 @@
                             resource_context_.GetRequestContext()));
     raw_ptr_to_request_ = request.get();
     ResourceRequestInfo::AllocateForTesting(request.get(),
-                                            ResourceType::MAIN_FRAME,
+                                            RESOURCE_TYPE_MAIN_FRAME,
                                             &resource_context_,
                                             kRenderProcessId,
                                             kRenderViewId,
diff --git a/content/browser/loader/resource_message_filter.h b/content/browser/loader/resource_message_filter.h
index b1baa40..cae7e64 100644
--- a/content/browser/loader/resource_message_filter.h
+++ b/content/browser/loader/resource_message_filter.h
@@ -60,8 +60,7 @@
                    net::URLRequestContext** request_context);
 
   // Returns the net::URLRequestContext for the given request.
-  net::URLRequestContext* GetURLRequestContext(
-      ResourceType::Type request_type);
+  net::URLRequestContext* GetURLRequestContext(ResourceType request_type);
 
   ChromeAppCacheService* appcache_service() const {
     return appcache_service_.get();
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc
index 8db5e34..0e5778a 100644
--- a/content/browser/loader/resource_request_info_impl.cc
+++ b/content/browser/loader/resource_request_info_impl.cc
@@ -23,14 +23,13 @@
 }
 
 // static
-void ResourceRequestInfo::AllocateForTesting(
-    net::URLRequest* request,
-    ResourceType::Type resource_type,
-    ResourceContext* context,
-    int render_process_id,
-    int render_view_id,
-    int render_frame_id,
-    bool is_async) {
+void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request,
+                                             ResourceType resource_type,
+                                             ResourceContext* context,
+                                             int render_process_id,
+                                             int render_view_id,
+                                             int render_frame_id,
+                                             bool is_async) {
   ResourceRequestInfoImpl* info =
       new ResourceRequestInfoImpl(
           PROCESS_TYPE_RENDERER,             // process_type
@@ -39,7 +38,7 @@
           0,                                 // origin_pid
           0,                                 // request_id
           render_frame_id,                   // render_frame_id
-          resource_type == ResourceType::MAIN_FRAME,  // is_main_frame
+          resource_type == RESOURCE_TYPE_MAIN_FRAME,  // is_main_frame
           false,                             // parent_is_main_frame
           0,                                 // parent_render_frame_id
           resource_type,                     // resource_type
@@ -96,7 +95,7 @@
     bool is_main_frame,
     bool parent_is_main_frame,
     int parent_render_frame_id,
-    ResourceType::Type resource_type,
+    ResourceType resource_type,
     PageTransition transition_type,
     bool should_replace_current_entry,
     bool is_download,
@@ -174,7 +173,7 @@
   return parent_render_frame_id_;
 }
 
-ResourceType::Type ResourceRequestInfoImpl::GetResourceType() const {
+ResourceType ResourceRequestInfoImpl::GetResourceType() const {
   return resource_type_;
 }
 
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index 2fe5a8ba..70465f7 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -49,7 +49,7 @@
       bool is_main_frame,
       bool parent_is_main_frame,
       int parent_render_frame_id,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       PageTransition transition_type,
       bool should_replace_current_entry,
       bool is_download,
@@ -73,7 +73,7 @@
   virtual bool IsMainFrame() const OVERRIDE;
   virtual bool ParentIsMainFrame() const OVERRIDE;
   virtual int GetParentRenderFrameID() const OVERRIDE;
-  virtual ResourceType::Type GetResourceType() const OVERRIDE;
+  virtual ResourceType GetResourceType() const OVERRIDE;
   virtual int GetProcessType() const OVERRIDE;
   virtual blink::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE;
   virtual blink::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
@@ -176,7 +176,7 @@
   bool allow_download_;
   bool has_user_gesture_;
   bool was_ignored_by_handler_;
-  ResourceType::Type resource_type_;
+  ResourceType resource_type_;
   PageTransition transition_type_;
   int memory_cost_;
   blink::WebReferrerPolicy referrer_policy_;
diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc
index e424c278..ea4fc02 100644
--- a/content/browser/loader/resource_scheduler_unittest.cc
+++ b/content/browser/loader/resource_scheduler_unittest.cc
@@ -175,7 +175,7 @@
         false,                                   // is_main_frame
         false,                                   // parent_is_main_frame
         0,                                       // parent_render_frame_id
-        ResourceType::SUB_RESOURCE,              // resource_type
+        RESOURCE_TYPE_SUB_RESOURCE,              // resource_type
         PAGE_TRANSITION_LINK,                    // transition_type
         false,                                   // should_replace_current_entry
         false,                                   // is_download
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 75b729f..1b49af5d 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -193,11 +193,11 @@
 net::URLRequestContext* GetRequestContext(
     scoped_refptr<net::URLRequestContextGetter> request_context,
     scoped_refptr<net::URLRequestContextGetter> media_request_context,
-    ResourceType::Type resource_type) {
-  // If the request has resource type of ResourceType::MEDIA, we use a request
+    ResourceType resource_type) {
+  // If the request has resource type of RESOURCE_TYPE_MEDIA, we use a request
   // context specific to media for handling it because these resources have
   // specific needs for caching.
-  if (resource_type == ResourceType::MEDIA)
+  if (resource_type == RESOURCE_TYPE_MEDIA)
     return media_request_context->GetURLRequestContext();
   return request_context->GetURLRequestContext();
 }
@@ -817,7 +817,7 @@
   WebSocketDispatcherHost::GetRequestContextCallback
       websocket_request_context_callback(
           base::Bind(&GetRequestContext, request_context,
-                     media_request_context, ResourceType::SUB_RESOURCE));
+                     media_request_context, RESOURCE_TYPE_SUB_RESOURCE));
 
   AddFilter(
       new WebSocketDispatcherHost(GetID(), websocket_request_context_callback));
diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.cc b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
index b08b119..c52023e 100644
--- a/content/browser/renderer_host/socket_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
@@ -144,7 +144,7 @@
   DCHECK(socket_stream_host);
   GlobalRequestID request_id(-1, socket_id);
   SSLManager::OnSSLCertificateError(
-      weak_ptr_factory_.GetWeakPtr(), request_id, ResourceType::SUB_RESOURCE,
+      weak_ptr_factory_.GetWeakPtr(), request_id, RESOURCE_TYPE_SUB_RESOURCE,
       socket->url(), render_process_id_, socket_stream_host->render_frame_id(),
       ssl_info, fatal);
 }
@@ -287,7 +287,7 @@
 }
 
 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() {
-  return request_context_callback_.Run(ResourceType::SUB_RESOURCE);
+  return request_context_callback_.Run(RESOURCE_TYPE_SUB_RESOURCE);
 }
 
 void SocketStreamDispatcherHost::Shutdown() {
diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.h b/content/browser/renderer_host/socket_stream_dispatcher_host.h
index c0836138..bc0e35f 100644
--- a/content/browser/renderer_host/socket_stream_dispatcher_host.h
+++ b/content/browser/renderer_host/socket_stream_dispatcher_host.h
@@ -32,7 +32,7 @@
       public net::SocketStream::Delegate,
       public SSLErrorHandler::Delegate {
  public:
-  typedef base::Callback<net::URLRequestContext*(ResourceType::Type)>
+  typedef base::Callback<net::URLRequestContext*(ResourceType)>
       GetRequestContextCallback;
   SocketStreamDispatcherHost(
       int render_process_id,
diff --git a/content/browser/renderer_host/websocket_host.cc b/content/browser/renderer_host/websocket_host.cc
index f778f06f..49cc39b4 100644
--- a/content/browser/renderer_host/websocket_host.cc
+++ b/content/browser/renderer_host/websocket_host.cc
@@ -280,7 +280,7 @@
   GlobalRequestID request_id(-1, -1);
   SSLManager::OnSSLCertificateError(ssl_error_handler_delegate_->GetWeakPtr(),
                                     request_id,
-                                    ResourceType::SUB_RESOURCE,
+                                    RESOURCE_TYPE_SUB_RESOURCE,
                                     url,
                                     dispatcher_->render_process_id(),
                                     render_frame_id_,
diff --git a/content/browser/service_worker/service_worker_context_request_handler.cc b/content/browser/service_worker/service_worker_context_request_handler.cc
index cc9b752..45248930 100644
--- a/content/browser/service_worker/service_worker_context_request_handler.cc
+++ b/content/browser/service_worker/service_worker_context_request_handler.cc
@@ -18,7 +18,7 @@
     base::WeakPtr<ServiceWorkerContextCore> context,
     base::WeakPtr<ServiceWorkerProviderHost> provider_host,
     base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-    ResourceType::Type resource_type)
+    ResourceType resource_type)
     : ServiceWorkerRequestHandler(context,
                                   provider_host,
                                   blob_storage_context,
@@ -45,8 +45,8 @@
   // retrieve it from the script cache.
   // TODO(michaeln): Get the desired behavior clarified in the spec,
   // and make tweak the behavior here to match.
-  if (resource_type_ != ResourceType::SERVICE_WORKER &&
-      resource_type_ != ResourceType::SCRIPT) {
+  if (resource_type_ != RESOURCE_TYPE_SERVICE_WORKER &&
+      resource_type_ != RESOURCE_TYPE_SCRIPT) {
     return NULL;
   }
 
diff --git a/content/browser/service_worker/service_worker_context_request_handler.h b/content/browser/service_worker/service_worker_context_request_handler.h
index 0a9eaf3..0c74927 100644
--- a/content/browser/service_worker/service_worker_context_request_handler.h
+++ b/content/browser/service_worker/service_worker_context_request_handler.h
@@ -20,7 +20,7 @@
       base::WeakPtr<ServiceWorkerContextCore> context,
       base::WeakPtr<ServiceWorkerProviderHost> provider_host,
       base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-      ResourceType::Type resource_type);
+      ResourceType resource_type);
   virtual ~ServiceWorkerContextRequestHandler();
 
   // Called via custom URLRequestJobFactory.
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 14212f2..bdea9e1 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -21,7 +21,7 @@
     base::WeakPtr<ServiceWorkerContextCore> context,
     base::WeakPtr<ServiceWorkerProviderHost> provider_host,
     base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-    ResourceType::Type resource_type)
+    ResourceType resource_type)
     : ServiceWorkerRequestHandler(context,
                                   provider_host,
                                   blob_storage_context,
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.h b/content/browser/service_worker/service_worker_controllee_request_handler.h
index 18297740..64f6555 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.h
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.h
@@ -28,7 +28,7 @@
       base::WeakPtr<ServiceWorkerContextCore> context,
       base::WeakPtr<ServiceWorkerProviderHost> provider_host,
       base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-      ResourceType::Type resource_type);
+      ResourceType resource_type);
   virtual ~ServiceWorkerControlleeRequestHandler();
 
   // Called via custom URLRequestJobFactory.
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
index a2e6a05..246dae3 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
@@ -98,7 +98,7 @@
           context()->AsWeakPtr(),
           provider_host_,
           base::WeakPtr<webkit_blob::BlobStorageContext>(),
-          ResourceType::MAIN_FRAME));
+          RESOURCE_TYPE_MAIN_FRAME));
   scoped_refptr<net::URLRequestJob> job =
       handler->MaybeCreateJob(request.get(), NULL);
   ServiceWorkerURLRequestJob* sw_job =
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 07e440f..85ea2ca 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -161,7 +161,7 @@
 
 scoped_ptr<ServiceWorkerRequestHandler>
 ServiceWorkerProviderHost::CreateRequestHandler(
-    ResourceType::Type resource_type,
+    ResourceType resource_type,
     base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context) {
   if (IsHostToRunningServiceWorker()) {
     return scoped_ptr<ServiceWorkerRequestHandler>(
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index e10cdf5..3175ef10 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -94,7 +94,7 @@
   // Returns a handler for a request, the handler may return NULL if
   // the request doesn't require special handling.
   scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler(
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context);
 
   // Returns true if |version| can be associated with this provider.
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index 0adbd57..7b615b3 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -59,7 +59,7 @@
     webkit_blob::BlobStorageContext* blob_storage_context,
     int process_id,
     int provider_id,
-    ResourceType::Type resource_type) {
+    ResourceType resource_type) {
   if (!IsSchemeAndMethodSupportedForAppCache(request)) {
     return;
   }
@@ -102,7 +102,7 @@
     base::WeakPtr<ServiceWorkerContextCore> context,
     base::WeakPtr<ServiceWorkerProviderHost> provider_host,
     base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-    ResourceType::Type resource_type)
+    ResourceType resource_type)
     : context_(context),
       provider_host_(provider_host),
       blob_storage_context_(blob_storage_context),
diff --git a/content/browser/service_worker/service_worker_request_handler.h b/content/browser/service_worker/service_worker_request_handler.h
index 1073f23b..e495abe 100644
--- a/content/browser/service_worker/service_worker_request_handler.h
+++ b/content/browser/service_worker/service_worker_request_handler.h
@@ -46,7 +46,7 @@
       webkit_blob::BlobStorageContext* blob_storage_context,
       int process_id,
       int provider_id,
-      ResourceType::Type resource_type);
+      ResourceType resource_type);
 
   // Returns the handler attached to |request|. This may return NULL
   // if no handler is attached.
@@ -72,12 +72,12 @@
       base::WeakPtr<ServiceWorkerContextCore> context,
       base::WeakPtr<ServiceWorkerProviderHost> provider_host,
       base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
-      ResourceType::Type resource_type);
+      ResourceType resource_type);
 
   base::WeakPtr<ServiceWorkerContextCore> context_;
   base::WeakPtr<ServiceWorkerProviderHost> provider_host_;
   base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_;
-  ResourceType::Type resource_type_;
+  ResourceType resource_type_;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
diff --git a/content/browser/service_worker/service_worker_utils.h b/content/browser/service_worker/service_worker_utils.h
index 60ce5ce..81d6c44 100644
--- a/content/browser/service_worker/service_worker_utils.h
+++ b/content/browser/service_worker/service_worker_utils.h
@@ -5,23 +5,18 @@
 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_UTILS_H_
 
+#include "base/macros.h"
 #include "content/common/content_export.h"
 #include "content/common/service_worker/service_worker_status_code.h"
 #include "content/public/common/resource_type.h"
-
-class GURL;
+#include "url/gurl.h"
 
 namespace content {
 
 class ServiceWorkerUtils {
  public:
-  static bool IsMainResourceType(ResourceType::Type type) {
-    return ResourceType::IsFrame(type) ||
-           ResourceType::IsSharedWorker(type);
-  }
-
-  static bool IsServiceWorkerResourceType(ResourceType::Type type) {
-    return ResourceType::IsServiceWorker(type);
+  static bool IsMainResourceType(ResourceType type) {
+    return IsResourceTypeFrame(type) || type == RESOURCE_TYPE_SHARED_WORKER;
   }
 
   // A helper for creating a do-nothing status callback.
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.cc b/content/browser/service_worker/service_worker_write_to_cache_job.cc
index 71db503..b3e6cad 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.cc
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.cc
@@ -21,7 +21,7 @@
 ServiceWorkerWriteToCacheJob::ServiceWorkerWriteToCacheJob(
     net::URLRequest* request,
     net::NetworkDelegate* network_delegate,
-    ResourceType::Type resource_type,
+    ResourceType resource_type,
     base::WeakPtr<ServiceWorkerContextCore> context,
     ServiceWorkerVersion* version,
     int64 response_id)
@@ -142,7 +142,7 @@
       request()->first_party_for_cookies());
   net_request_->SetReferrer(request()->referrer());
 
-  if (resource_type_ == ResourceType::SERVICE_WORKER) {
+  if (resource_type_ == RESOURCE_TYPE_SERVICE_WORKER) {
     // This will get copied into net_request_ when URLRequest::StartJob calls
     // ServiceWorkerWriteToCacheJob::SetExtraRequestHeaders.
     request()->SetExtraRequestHeaderByName("Service-Worker", "script", true);
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.h b/content/browser/service_worker/service_worker_write_to_cache_job.h
index ecc2a6d..6833227 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.h
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.h
@@ -37,7 +37,7 @@
   ServiceWorkerWriteToCacheJob(
       net::URLRequest* request,
       net::NetworkDelegate* network_delegate,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       base::WeakPtr<ServiceWorkerContextCore> context,
       ServiceWorkerVersion* version,
       int64 response_id);
@@ -99,7 +99,7 @@
 
   void AsyncNotifyDoneHelper(const net::URLRequestStatus& status);
 
-  ResourceType::Type resource_type_;  // Differentiate main script and imports
+  ResourceType resource_type_;  // Differentiate main script and imports
   scoped_refptr<net::IOBuffer> io_buffer_;
   scoped_refptr<HttpResponseInfoIOBuffer> info_buffer_;
   base::WeakPtr<ServiceWorkerContextCore> context_;
diff --git a/content/browser/ssl/ssl_cert_error_handler.cc b/content/browser/ssl/ssl_cert_error_handler.cc
index a69e993..a3e6a26 100644
--- a/content/browser/ssl/ssl_cert_error_handler.cc
+++ b/content/browser/ssl/ssl_cert_error_handler.cc
@@ -14,13 +14,17 @@
 SSLCertErrorHandler::SSLCertErrorHandler(
     const base::WeakPtr<Delegate>& delegate,
     const GlobalRequestID& id,
-    ResourceType::Type resource_type,
+    ResourceType resource_type,
     const GURL& url,
     int render_process_id,
     int render_frame_id,
     const net::SSLInfo& ssl_info,
     bool fatal)
-    : SSLErrorHandler(delegate, id, resource_type, url, render_process_id,
+    : SSLErrorHandler(delegate,
+                      id,
+                      resource_type,
+                      url,
+                      render_process_id,
                       render_frame_id),
       ssl_info_(ssl_info),
       cert_error_(net::MapCertStatusToNetError(ssl_info.cert_status)),
diff --git a/content/browser/ssl/ssl_cert_error_handler.h b/content/browser/ssl/ssl_cert_error_handler.h
index 6946f42..4e14690 100644
--- a/content/browser/ssl/ssl_cert_error_handler.h
+++ b/content/browser/ssl/ssl_cert_error_handler.h
@@ -21,7 +21,7 @@
   // Construct on the IO thread.
   SSLCertErrorHandler(const base::WeakPtr<Delegate>& delegate,
                       const GlobalRequestID& id,
-                      ResourceType::Type resource_type,
+                      ResourceType resource_type,
                       const GURL& url,
                       int render_process_id,
                       int render_frame_id,
diff --git a/content/browser/ssl/ssl_error_handler.cc b/content/browser/ssl/ssl_error_handler.cc
index 6d120a9e..8c2c37b 100644
--- a/content/browser/ssl/ssl_error_handler.cc
+++ b/content/browser/ssl/ssl_error_handler.cc
@@ -20,7 +20,7 @@
 
 SSLErrorHandler::SSLErrorHandler(const base::WeakPtr<Delegate>& delegate,
                                  const GlobalRequestID& id,
-                                 ResourceType::Type resource_type,
+                                 ResourceType resource_type,
                                  const GURL& url,
                                  int render_process_id,
                                  int render_frame_id)
diff --git a/content/browser/ssl/ssl_error_handler.h b/content/browser/ssl/ssl_error_handler.h
index 6b0834b..4a1b3f3 100644
--- a/content/browser/ssl/ssl_error_handler.h
+++ b/content/browser/ssl/ssl_error_handler.h
@@ -75,7 +75,7 @@
   const GURL& request_url() const { return request_url_; }
 
   // Available on either thread.
-  ResourceType::Type resource_type() const { return resource_type_; }
+  ResourceType resource_type() const { return resource_type_; }
 
   // Cancels the associated net::URLRequest.
   // This method can be called from OnDispatchFailed and OnDispatched.
@@ -109,7 +109,7 @@
   // Construct on the IO thread.
   SSLErrorHandler(const base::WeakPtr<Delegate>& delegate,
                   const GlobalRequestID& id,
-                  ResourceType::Type resource_type,
+                  ResourceType resource_type,
                   const GURL& url,
                   int render_process_id,
                   int render_frame_id);
@@ -158,7 +158,7 @@
   // What kind of resource is associated with the requested that generated
   // that error.
   // This read-only member can be accessed on any thread.
-  const ResourceType::Type resource_type_;
+  const ResourceType resource_type_;
 
   // A flag to make sure we notify the net::URLRequest exactly once.
   // Should only be accessed on the IO thread
diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc
index 68906ce..dcae75e 100644
--- a/content/browser/ssl/ssl_manager.cc
+++ b/content/browser/ssl/ssl_manager.cc
@@ -50,7 +50,7 @@
 void SSLManager::OnSSLCertificateError(
     const base::WeakPtr<SSLErrorHandler::Delegate>& delegate,
     const GlobalRequestID& id,
-    const ResourceType::Type resource_type,
+    const ResourceType resource_type,
     const GURL& url,
     int render_process_id,
     int render_frame_id,
@@ -171,7 +171,7 @@
   // resouces aren't cachable.
   scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo(
       details.url,
-      ResourceType::SUB_RESOURCE,
+      RESOURCE_TYPE_SUB_RESOURCE,
       details.pid,
       details.cert_id,
       details.cert_status));
diff --git a/content/browser/ssl/ssl_manager.h b/content/browser/ssl/ssl_manager.h
index c195e981..1bc81da 100644
--- a/content/browser/ssl/ssl_manager.h
+++ b/content/browser/ssl/ssl_manager.h
@@ -51,7 +51,7 @@
   static void OnSSLCertificateError(
       const base::WeakPtr<SSLErrorHandler::Delegate>& delegate,
       const GlobalRequestID& id,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       const GURL& url,
       int render_process_id,
       int render_frame_id,
diff --git a/content/browser/ssl/ssl_request_info.cc b/content/browser/ssl/ssl_request_info.cc
index 0c23f83a..f22376ac 100644
--- a/content/browser/ssl/ssl_request_info.cc
+++ b/content/browser/ssl/ssl_request_info.cc
@@ -7,7 +7,7 @@
 namespace content {
 
 SSLRequestInfo::SSLRequestInfo(const GURL& url,
-                               ResourceType::Type resource_type,
+                               ResourceType resource_type,
                                int child_id,
                                int ssl_cert_id,
                                net::CertStatus ssl_cert_status)
diff --git a/content/browser/ssl/ssl_request_info.h b/content/browser/ssl/ssl_request_info.h
index 9498c89..9f50448 100644
--- a/content/browser/ssl/ssl_request_info.h
+++ b/content/browser/ssl/ssl_request_info.h
@@ -20,13 +20,13 @@
 class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
  public:
   SSLRequestInfo(const GURL& url,
-                 ResourceType::Type resource_type,
+                 ResourceType resource_type,
                  int child_id,
                  int ssl_cert_id,
                  net::CertStatus ssl_cert_status);
 
   const GURL& url() const { return url_; }
-  ResourceType::Type resource_type() const { return resource_type_; }
+  ResourceType resource_type() const { return resource_type_; }
   int child_id() const { return child_id_; }
   int ssl_cert_id() const { return ssl_cert_id_; }
   net::CertStatus ssl_cert_status() const { return ssl_cert_status_; }
@@ -37,7 +37,7 @@
   virtual ~SSLRequestInfo();
 
   GURL url_;
-  ResourceType::Type resource_type_;
+  ResourceType resource_type_;
   int child_id_;
   int ssl_cert_id_;
   net::CertStatus ssl_cert_status_;
diff --git a/content/browser/transition_browsertest.cc b/content/browser/transition_browsertest.cc
index 5cc07e6..3ffaadb 100644
--- a/content/browser/transition_browsertest.cc
+++ b/content/browser/transition_browsertest.cc
@@ -42,7 +42,7 @@
       net::URLRequest* request,
       ResourceContext* resource_context,
       AppCacheService* appcache_service,
-      ResourceType::Type resource_type,
+      ResourceType resource_type,
       int child_id,
       int route_id,
       ScopedVector<ResourceThrottle>* throttles) OVERRIDE {
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(
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 765ac46..a8455ef 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -734,7 +734,7 @@
                                         const std::string& security_info,
                                         const std::string& http_request,
                                         const std::string& mime_type,
-                                        ResourceType::Type resource_type);
+                                        ResourceType resource_type);
   void OnDidDisplayInsecureContent();
   void OnDidRunInsecureContent(const std::string& security_origin,
                                const GURL& target_url);