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

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

Issue 601843002: Merge web_request_api_utils back into web_request_api_helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: extensions/browser/api/web_request/web_request_api_helpers.h
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.h b/extensions/browser/api/web_request/web_request_api_helpers.h
index 16f58a629cf459d795bc9f87a42d890d295bd866..a7ae5dd67b9f6e6a9d798a45cb876f5121d7c000 100644
--- a/extensions/browser/api/web_request/web_request_api_helpers.h
+++ b/extensions/browser/api/web_request/web_request_api_helpers.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
+#include "content/public/common/resource_type.h"
#include "extensions/browser/warning_set.h"
#include "net/base/auth.h"
#include "net/http/http_request_headers.h"
@@ -41,7 +42,6 @@ class URLRequest;
namespace extension_web_request_api_helpers {
-
typedef std::pair<std::string, std::string> ResponseHeader;
typedef std::vector<ResponseHeader> ResponseHeaders;
@@ -326,6 +326,20 @@ void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host);
base::DictionaryValue* CreateHeaderDictionary(
const std::string& name, const std::string& value);
+// Returns whether |type| is a ResourceType that is handled by the web request
+// API.
+bool IsRelevantResourceType(content::ResourceType type);
+
+// Returns a string representation of |type| or |other| if |type| is not handled
+// by the web request API.
+const char* ResourceTypeToString(content::ResourceType type);
+
+// Stores a |content::ResourceType| representation in |type| if |type_str| is
+// a resource type handled by the web request API. Returns true in case of
+// success.
+bool ParseResourceType(const std::string& type_str,
+ content::ResourceType* type);
+
} // namespace extension_web_request_api_helpers
#endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.cc ('k') | extensions/browser/api/web_request/web_request_api_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698