summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 13:28:11 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 13:28:11 +0000
commit5f450e5c6fc98a762cebb38cd080731bedd61ae3 (patch)
treede1e6a257709c220222a6ab9defac23aade6e45c /net/url_request
parent60147f3b071444f0abfb320e62a0c9f2b666d443 (diff)
downloadchromium_src-5f450e5c6fc98a762cebb38cd080731bedd61ae3.zip
chromium_src-5f450e5c6fc98a762cebb38cd080731bedd61ae3.tar.gz
chromium_src-5f450e5c6fc98a762cebb38cd080731bedd61ae3.tar.bz2
Navigation and cookies for Automation
Give Automation better visibility and control over navigations. Also, make it possible for automation to implement a dummy cookie store to go with dummy request serving over automation. BUG=none TEST=none Review URL: http://codereview.chromium.org/159189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_context.h10
-rw-r--r--net/url_request/url_request_http_job.cc9
2 files changed, 9 insertions, 10 deletions
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 486ade0..3682112 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -13,11 +13,11 @@
#include "base/ref_counted.h"
#include "base/string_util.h"
#include "net/base/cookie_policy.h"
+#include "net/base/cookie_store.h"
#include "net/base/host_resolver.h"
#include "net/ftp/ftp_auth_cache.h"
namespace net {
-class CookieMonster;
class ForceTLSState;
class FtpTransactionFactory;
class HttpTransactionFactory;
@@ -60,7 +60,7 @@ class URLRequestContext :
}
// Gets the cookie store for this context.
- net::CookieMonster* cookie_store() { return cookie_store_; }
+ net::CookieStore* cookie_store() { return cookie_store_; }
// Gets the cookie policy for this context.
net::CookiePolicy* cookie_policy() { return &cookie_policy_; }
@@ -96,13 +96,13 @@ class URLRequestContext :
// Called for each cookie returning for the given request. A pointer to
// the cookie is passed so that it can be modified. Returns true if the
// cookie was not dropped (it could still be modified though).
- virtual bool interceptCookie(const URLRequest* request, std::string* cookie) {
+ virtual bool InterceptCookie(const URLRequest* request, std::string* cookie) {
return true;
}
// Called before adding cookies to sent requests. Allows overriding
// requests to block sending of cookies.
- virtual bool allowSendingCookies(const URLRequest* request) const {
+ virtual bool AllowSendingCookies(const URLRequest* request) const {
return true;
}
@@ -117,7 +117,7 @@ class URLRequestContext :
net::ProxyService* proxy_service_;
net::HttpTransactionFactory* http_transaction_factory_;
net::FtpTransactionFactory* ftp_transaction_factory_;
- net::CookieMonster* cookie_store_;
+ net::CookieStore* cookie_store_;
net::CookiePolicy cookie_policy_;
net::ForceTLSState* force_tls_state_;;
net::FtpAuthCache ftp_auth_cache_;
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 20c7d88..cf2b63c 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -13,7 +13,6 @@
#include "base/rand_util.h"
#include "base/string_util.h"
#include "net/base/cert_status_flags.h"
-#include "net/base/cookie_monster.h"
#include "net/base/filter.h"
#include "net/base/force_tls_state.h"
#include "net/base/load_flags.h"
@@ -529,7 +528,7 @@ void URLRequestHttpJob::NotifyHeadersComplete() {
ctx->cookie_policy()->CanSetCookie(
request_->url(), request_->first_party_for_cookies())) {
FetchResponseCookies();
- net::CookieMonster::CookieOptions options;
+ net::CookieOptions options;
options.set_include_httponly();
ctx->cookie_store()->SetCookiesWithOptions(request_->url(),
response_cookies_,
@@ -663,7 +662,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
URLRequestContext* context = request_->context();
if (context) {
- if (context->allowSendingCookies(request_))
+ if (context->AllowSendingCookies(request_))
request_info_.extra_headers += AssembleRequestCookies();
if (!context->accept_language().empty())
request_info_.extra_headers += "Accept-Language: " +
@@ -681,7 +680,7 @@ std::string URLRequestHttpJob::AssembleRequestCookies() {
if (context->cookie_store() &&
context->cookie_policy()->CanGetCookies(
request_->url(), request_->first_party_for_cookies())) {
- net::CookieMonster::CookieOptions options;
+ net::CookieOptions options;
options.set_include_httponly();
std::string cookies = request_->context()->cookie_store()->
GetCookiesWithOptions(request_->url(), options);
@@ -701,7 +700,7 @@ void URLRequestHttpJob::FetchResponseCookies() {
void* iter = NULL;
while (response_info_->headers->EnumerateHeader(&iter, name, &value))
- if (request_->context()->interceptCookie(request_, &value))
+ if (request_->context()->InterceptCookie(request_, &value))
response_cookies_.push_back(value);
}