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

Unified Diff: chrome/browser/extensions/extension_webrequest_api.h

Issue 8015004: webRequest.onAuthRequired listeners can provide authentication credentials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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/extension_webrequest_api.h
diff --git a/chrome/browser/extensions/extension_webrequest_api.h b/chrome/browser/extensions/extension_webrequest_api.h
index f44d5b72e4bd7d341abffd354c6d2eda7e256573..c02ae4ce08612075a522b8e85cd986c8d1f93bf6 100644
--- a/chrome/browser/extensions/extension_webrequest_api.h
+++ b/chrome/browser/extensions/extension_webrequest_api.h
@@ -32,6 +32,7 @@ class StringValue;
}
namespace net {
+class AuthCredentials;
class AuthChallengeInfo;
class HostPortPair;
class HttpRequestHeaders;
@@ -103,6 +104,7 @@ class ExtensionWebRequestEventRouter {
bool cancel;
GURL new_url;
scoped_ptr<net::HttpRequestHeaders> request_headers;
+ scoped_ptr<net::AuthCredentials> auth_credentials;
EventResponse(const std::string& extension_id,
const base::Time& extension_install_time);
@@ -131,6 +133,9 @@ class ExtensionWebRequestEventRouter {
// Keys of request headers to be deleted.
std::vector<std::string> deleted_request_headers;
+ // Authentication Credentials to use.
+ scoped_ptr<net::AuthCredentials> auth_credentials;
+
EventResponseDelta(const std::string& extension_id,
const base::Time& extension_install_time);
~EventResponseDelta();
@@ -171,11 +176,15 @@ class ExtensionWebRequestEventRouter {
net::URLRequest* request,
const net::HttpRequestHeaders& headers);
- // Dispatches the onAuthRequired event.
- void OnAuthRequired(void* profile,
+ // Dispatches the OnAuthRequired event to any extensions whose filters match
+ // the given request. Returns net::ERR_IO_PENDING if an extension is
+ // intercepting the request, OK otherwise.
+ int OnAuthRequired(void* profile,
ExtensionInfoMap* extension_info_map,
net::URLRequest* request,
- const net::AuthChallengeInfo& auth_info);
+ const net::AuthChallengeInfo& auth_info,
+ net::CompletionCallback* callback,
+ net::AuthCredentials* credentials);
// Dispatches the onBeforeRedirect event. This is fired for HTTP(s) requests
// only.
@@ -335,6 +344,15 @@ class ExtensionWebRequestEventRouter {
BlockedRequest* request,
std::list<std::string>* conflicting_extensions) const;
+ // Merge the responses of blocked onAuthRequired handlers. The first
+ // registered listener that supplies authentication credentials in a response,
Matt Perry 2011/09/26 21:19:45 This comment is inaccurate. Since the |deltas| are
+ // if any, will have its authentication credentials used. |request| must be
+ // non-NULL, and contain |deltas| that are sorted in decreasing order of
+ // precedence.
+ void MergeOnAuthRequiredResponses(
+ BlockedRequest* request,
+ std::list<std::string>* conflicting_extensions) const;
+
// A map for each profile that maps an event name to a set of extensions that
// are listening to that event.
ListenerMap listeners_;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webrequest_api.cc » ('j') | net/url_request/url_request.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698