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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc

Issue 562913002: Move web_request_condition* files to extensions/browser/api/declarative_webrequest/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to master@294403 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
index 2cfbde51a4798814f8ae1ad0d335c069665f3971..26f1ef6052807f6e9ac60cf74edd9dccf06dc77a 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
@@ -32,7 +32,6 @@
// top of this file.
using base::Time;
-using content::ResourceType;
using net::cookie_util::ParsedRequestCookie;
using net::cookie_util::ParsedRequestCookies;
@@ -42,39 +41,6 @@ namespace {
typedef std::vector<linked_ptr<net::ParsedCookie> > ParsedResponseCookies;
-static const char* kResourceTypeStrings[] = {
- "main_frame",
- "sub_frame",
- "stylesheet",
- "script",
- "image",
- "object",
- "xmlhttprequest",
- "other",
- "other",
-};
-
-static ResourceType kResourceTypeValues[] = {
- content::RESOURCE_TYPE_MAIN_FRAME,
- content::RESOURCE_TYPE_SUB_FRAME,
- content::RESOURCE_TYPE_STYLESHEET,
- content::RESOURCE_TYPE_SCRIPT,
- content::RESOURCE_TYPE_IMAGE,
- content::RESOURCE_TYPE_OBJECT,
- content::RESOURCE_TYPE_XHR,
- content::RESOURCE_TYPE_LAST_TYPE, // represents "other"
- // TODO(jochen): We duplicate the last entry, so the array's size is not a
- // power of two. If it is, this triggers a bug in gcc 4.4 in Release builds
- // (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949). Once we use a version
- // of gcc with this bug fixed, or the array is changed so this duplicate
- // entry is no longer required, this should be removed.
- content::RESOURCE_TYPE_LAST_TYPE,
-};
-
-COMPILE_ASSERT(
- arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues),
- keep_resource_types_in_sync);
-
void ClearCacheOnNavigationOnUI() {
WebCacheManager::GetInstance()->ClearCacheOnNavigation();
}
@@ -1180,34 +1146,6 @@ bool MergeOnAuthRequiredResponses(
return credentials_set;
}
-
-#define ARRAYEND(array) (array + arraysize(array))
-
-bool IsRelevantResourceType(ResourceType type) {
- ResourceType* iter =
- std::find(kResourceTypeValues, ARRAYEND(kResourceTypeValues), type);
- return iter != ARRAYEND(kResourceTypeValues);
-}
-
-const char* ResourceTypeToString(ResourceType type) {
- ResourceType* iter =
- std::find(kResourceTypeValues, ARRAYEND(kResourceTypeValues), type);
- if (iter == ARRAYEND(kResourceTypeValues))
- return "other";
-
- return kResourceTypeStrings[iter - kResourceTypeValues];
-}
-
-bool ParseResourceType(const std::string& type_str,
- ResourceType* type) {
- const char** iter =
- std::find(kResourceTypeStrings, ARRAYEND(kResourceTypeStrings), type_str);
- if (iter == ARRAYEND(kResourceTypeStrings))
- return false;
- *type = kResourceTypeValues[iter - kResourceTypeStrings];
- return true;
-}
-
void ClearCacheOnNavigation() {
if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
ClearCacheOnNavigationOnUI();
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698