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

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

Issue 1515703005: WebRequest API: add more resource types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: extensions/browser/api/web_request/web_request_api_helpers.cc
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.cc b/extensions/browser/api/web_request/web_request_api_helpers.cc
index 35060deaa6f62213b62887da7f36190369014950..2cf1f179b89ab10992b856a9ea2dd92b96617619 100644
--- a/extensions/browser/api/web_request/web_request_api_helpers.cc
+++ b/extensions/browser/api/web_request/web_request_api_helpers.cc
@@ -51,9 +51,15 @@ static const char* kResourceTypeStrings[] = {
"stylesheet",
"script",
"image",
+ "font",
"object",
+ "script",
+ "script",
+ "image",
"xmlhttprequest",
- "other",
+ "ping",
+ "script",
+ "object",
"other",
};
@@ -65,15 +71,16 @@ static ResourceType kResourceTypeValues[] = {
content::RESOURCE_TYPE_STYLESHEET,
content::RESOURCE_TYPE_SCRIPT,
content::RESOURCE_TYPE_IMAGE,
+ content::RESOURCE_TYPE_FONT_RESOURCE,
content::RESOURCE_TYPE_OBJECT,
+ content::RESOURCE_TYPE_WORKER,
+ content::RESOURCE_TYPE_SHARED_WORKER,
+ content::RESOURCE_TYPE_FAVICON,
content::RESOURCE_TYPE_XHR,
+ content::RESOURCE_TYPE_PING,
+ content::RESOURCE_TYPE_SERVICE_WORKER,
+ content::RESOURCE_TYPE_PLUGIN_RESOURCE,
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,
battre 2015/12/15 12:53:09 Jochen: FYI
robwu 2015/12/15 13:17:25 I removed this because the referenced bug is about
};
const size_t kResourceTypeValuesLength = arraysize(kResourceTypeValues);
@@ -1249,8 +1256,6 @@ base::DictionaryValue* CreateHeaderDictionary(
return header;
}
-#define ARRAYEND(array) (array + arraysize(array))
-
bool IsRelevantResourceType(ResourceType type) {
ResourceType* iter =
std::find(kResourceTypeValues,

Powered by Google App Engine
This is Rietveld 408576698