summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 15:26:13 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 15:26:13 +0000
commit94e2bbe39fe667dd072755c0310fe42f73e0bb66 (patch)
treea7ecb732c9cfabad2332dda3827c18ca7ae83bb6 /webkit
parentd6effdd6a54173c0e11240fb753cc167f2499b34 (diff)
downloadchromium_src-94e2bbe39fe667dd072755c0310fe42f73e0bb66.zip
chromium_src-94e2bbe39fe667dd072755c0310fe42f73e0bb66.tar.gz
chromium_src-94e2bbe39fe667dd072755c0310fe42f73e0bb66.tar.bz2
Added URLRequestContext to constructor for URLRequest.
Previously, the context was set using the member function set_context. Note that the context for a URLRequest is not allowed to be null. BUG=81979 TEST=None TBR=ajwong,brettw,vitalybuka,sky Review URL: https://chromiumcodereview.appspot.com/10559036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/appcache/appcache_request_handler_unittest.cc42
-rw-r--r--webkit/appcache/appcache_update_job.cc9
-rw-r--r--webkit/appcache/appcache_url_request_job_unittest.cc22
-rw-r--r--webkit/blob/blob_url_request_job_unittest.cc5
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.cc5
-rw-r--r--webkit/fileapi/file_system_dir_url_request_job_unittest.cc7
-rw-r--r--webkit/fileapi/file_system_operation.cc5
-rw-r--r--webkit/fileapi/file_system_url_request_job_unittest.cc5
-rw-r--r--webkit/fileapi/file_writer_delegate_unittest.cc10
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc3
10 files changed, 73 insertions, 40 deletions
diff --git a/webkit/appcache/appcache_request_handler_unittest.cc b/webkit/appcache/appcache_request_handler_unittest.cc
index 98f41a8..5e6e928 100644
--- a/webkit/appcache/appcache_request_handler_unittest.cc
+++ b/webkit/appcache/appcache_request_handler_unittest.cc
@@ -15,6 +15,7 @@
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_error_job.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache.h"
@@ -107,7 +108,9 @@ class AppCacheRequestHandlerTest : public testing::Test {
class MockURLRequest : public net::URLRequest {
public:
- explicit MockURLRequest(const GURL& url) : net::URLRequest(url, NULL) {}
+ explicit MockURLRequest(const GURL& url, net::URLRequestContext* context) :
+ net::URLRequest(url, NULL, context) {
+ }
void SimulateResponseCode(int http_response_code) {
mock_factory_job_ = new MockURLRequestJob(this, http_response_code);
@@ -173,6 +176,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
orig_http_factory_ = net::URLRequest::Deprecated::RegisterProtocolFactory(
"http", MockHttpJobFactory);
mock_service_.reset(new MockAppCacheService);
+ mock_service_->set_request_context(&empty_context_);
mock_policy_.reset(new MockAppCachePolicy);
mock_service_->set_appcache_policy(mock_policy_.get());
mock_frontend_.reset(new MockFrontend);
@@ -236,7 +240,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
base::Bind(&AppCacheRequestHandlerTest::Verify_MainResource_Miss,
base::Unretained(this)));
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -279,7 +283,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
base::Bind(&AppCacheRequestHandlerTest::Verify_MainResource_Hit,
base::Unretained(this)));
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -325,7 +329,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
base::Bind(&AppCacheRequestHandlerTest::Verify_MainResource_Fallback,
base::Unretained(this)));
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -382,7 +386,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
&AppCacheRequestHandlerTest::Verify_MainResource_FallbackOverride,
base::Unretained(this)));
- request_.reset(new MockURLRequest(GURL("http://blah/fallback-override")));
+ request_.reset(new MockURLRequest(GURL("http://blah/fallback-override"),
+ &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -431,7 +436,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// SubResource_Miss_WithNoCacheSelected ----------------------------------
void SubResource_Miss_WithNoCacheSelected() {
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
@@ -449,7 +454,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// in a network or fallback namespace, should result in a failed request.
host_->AssociateCompleteCache(MakeNewCache());
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -476,7 +481,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
host_->pending_selected_cache_id_ = cache->cache_id();
host_->set_preferred_manifest_url(cache->owning_group()->manifest_url());
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -506,7 +511,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
mock_storage()->SimulateFindSubResource(
AppCacheEntry(AppCacheEntry::EXPLICIT, 1), AppCacheEntry(), false);
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -534,7 +539,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
mock_storage()->SimulateFindSubResource(
AppCacheEntry(), AppCacheEntry(AppCacheEntry::EXPLICIT, 1), false);
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -563,7 +568,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
mock_storage()->SimulateFindSubResource(
AppCacheEntry(), AppCacheEntry(AppCacheEntry::EXPLICIT, 1), false);
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -593,7 +598,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
mock_storage()->SimulateFindSubResource(
AppCacheEntry(), AppCacheEntry(), true);
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -618,7 +623,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
mock_storage()->SimulateFindSubResource(
AppCacheEntry(AppCacheEntry::EXPLICIT, 1), AppCacheEntry(), false);
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -640,7 +645,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// Precondition, the host is waiting on cache selection.
host_->pending_selected_cache_id_ = 1;
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get());
@@ -667,7 +672,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// Precondition, the host is waiting on cache selection.
host_->pending_selected_cache_id_ = 1;
- request_.reset(new MockURLRequest(GURL("ftp://blah/")));
+ request_.reset(new MockURLRequest(GURL("ftp://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::SUB_RESOURCE));
EXPECT_TRUE(handler_.get()); // we could redirect to http (conceivably)
@@ -683,7 +688,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// CanceledRequest -----------------------------
void CanceledRequest() {
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -717,7 +722,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
EXPECT_FALSE(AppCacheRequestHandler::IsMainResourceType(
ResourceType::WORKER));
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
const int kParentHostId = host_->host_id();
const int kWorkerHostId = 2;
@@ -754,7 +759,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
base::Bind(&AppCacheRequestHandlerTest::Verify_MainResource_Blocked,
base::Unretained(this)));
- request_.reset(new MockURLRequest(GURL("http://blah/")));
+ request_.reset(new MockURLRequest(GURL("http://blah/"), &empty_context_));
handler_.reset(host_->CreateRequestHandler(request_.get(),
ResourceType::MAIN_FRAME));
EXPECT_TRUE(handler_.get());
@@ -813,6 +818,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
scoped_ptr<MockFrontend> mock_frontend_;
scoped_ptr<MockAppCachePolicy> mock_policy_;
AppCacheHost* host_;
+ net::URLRequestContext empty_context_;
scoped_ptr<MockURLRequest> request_;
scoped_ptr<AppCacheRequestHandler> handler_;
scoped_refptr<AppCacheURLRequestJob> job_;
diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc
index 02fc15b..29e3b1a4 100644
--- a/webkit/appcache/appcache_update_job.cc
+++ b/webkit/appcache/appcache_update_job.cc
@@ -98,14 +98,15 @@ AppCacheUpdateJob::URLFetcher::URLFetcher(
retry_503_attempts_(0),
buffer_(new net::IOBuffer(kBufferSize)),
ALLOW_THIS_IN_INITIALIZER_LIST(
- request_(new net::URLRequest(url, this))) {
+ request_(new net::URLRequest(url,
+ this,
+ job->service_->request_context()))) {
}
AppCacheUpdateJob::URLFetcher::~URLFetcher() {
}
void AppCacheUpdateJob::URLFetcher::Start() {
- request_->set_context(job_->service_->request_context());
request_->set_first_party_for_cookies(job_->manifest_url_);
request_->set_load_flags(request_->load_flags() |
net::LOAD_DISABLE_INTERCEPT);
@@ -287,7 +288,9 @@ bool AppCacheUpdateJob::URLFetcher::MaybeRetryRequest() {
return false;
}
++retry_503_attempts_;
- request_.reset(new net::URLRequest(url_, this));
+ request_.reset(new net::URLRequest(url_,
+ this,
+ job_->service_->request_context()));
Start();
return true;
}
diff --git a/webkit/appcache/appcache_url_request_job_unittest.cc b/webkit/appcache/appcache_url_request_job_unittest.cc
index 43ae76b..1c2d1f1 100644
--- a/webkit/appcache/appcache_url_request_job_unittest.cc
+++ b/webkit/appcache/appcache_url_request_job_unittest.cc
@@ -16,6 +16,7 @@
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_error_job.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache_response.h"
@@ -369,7 +370,7 @@ class AppCacheURLRequestJobTest : public testing::Test {
// Basic -------------------------------------------------------------------
void Basic() {
AppCacheStorage* storage = service_->storage();
- net::URLRequest request(GURL("http://blah/"), NULL);
+ net::URLRequest request(GURL("http://blah/"), NULL, &empty_context_);
scoped_refptr<AppCacheURLRequestJob> job;
// Create an instance and see that it looks as expected.
@@ -391,7 +392,7 @@ class AppCacheURLRequestJobTest : public testing::Test {
// DeliveryOrders -----------------------------------------------------
void DeliveryOrders() {
AppCacheStorage* storage = service_->storage();
- net::URLRequest request(GURL("http://blah/"), NULL);
+ net::URLRequest request(GURL("http://blah/"), NULL, &empty_context_);
scoped_refptr<AppCacheURLRequestJob> job;
// Create an instance, give it a delivery order and see that
@@ -436,7 +437,9 @@ class AppCacheURLRequestJobTest : public testing::Test {
AppCacheStorage* storage = service_->storage();
request_.reset(
- new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get()));
+ new net::URLRequest(GURL("http://blah/"),
+ url_request_delegate_.get(),
+ &empty_context_));
// Setup to create an AppCacheURLRequestJob with orders to deliver
// a network response.
@@ -469,7 +472,9 @@ class AppCacheURLRequestJobTest : public testing::Test {
AppCacheStorage* storage = service_->storage();
request_.reset(
- new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get()));
+ new net::URLRequest(GURL("http://blah/"),
+ url_request_delegate_.get(),
+ &empty_context_));
// Setup to create an AppCacheURLRequestJob with orders to deliver
// a network response.
@@ -517,7 +522,9 @@ class AppCacheURLRequestJobTest : public testing::Test {
void RequestAppCachedResource(bool start_after_delivery_orders) {
AppCacheStorage* storage = service_->storage();
request_.reset(
- new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get()));
+ new net::URLRequest(GURL("http://blah/"),
+ url_request_delegate_.get(),
+ &empty_context_));
// Setup to create an AppCacheURLRequestJob with orders to deliver
// a network response.
@@ -629,7 +636,9 @@ class AppCacheURLRequestJobTest : public testing::Test {
void MakeRangeRequest() {
AppCacheStorage* storage = service_->storage();
request_.reset(
- new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get()));
+ new net::URLRequest(GURL("http://blah/"),
+ url_request_delegate_.get(),
+ &empty_context_));
// Request a range, the 3 middle chars out of 'Hello'
net::HttpRequestHeaders extra_headers;
@@ -747,6 +756,7 @@ class AppCacheURLRequestJobTest : public testing::Test {
int writer_deletion_count_down_;
net::URLRequest::ProtocolFactory* orig_http_factory_;
+ net::URLRequestContext empty_context_;
scoped_ptr<net::URLRequest> request_;
scoped_ptr<MockURLRequestDelegate> url_request_delegate_;
diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc
index 515574a..a9462e6 100644
--- a/webkit/blob/blob_url_request_job_unittest.cc
+++ b/webkit/blob/blob_url_request_job_unittest.cc
@@ -22,6 +22,7 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_error_job.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/blob/blob_data.h"
@@ -242,7 +243,8 @@ class BlobURLRequestJobTest : public testing::Test {
BlobData* blob_data) {
// This test has async steps.
request_.reset(new net::URLRequest(GURL("blob:blah"),
- url_request_delegate_.get()));
+ url_request_delegate_.get(),
+ &empty_context_));
request_->set_method(method);
blob_url_request_job_ = new BlobURLRequestJob(
request_.get(),
@@ -397,6 +399,7 @@ class BlobURLRequestJobTest : public testing::Test {
scoped_ptr<base::WaitableEvent> test_finished_event_;
std::stack<std::pair<base::Closure, bool> > task_stack_;
+ net::URLRequestContext empty_context_;
scoped_ptr<net::URLRequest> request_;
scoped_ptr<MockURLRequestDelegate> url_request_delegate_;
int expected_status_code_;
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.cc b/webkit/chromeos/fileapi/remote_file_system_operation.cc
index e3a551b..2982607 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.cc
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.cc
@@ -119,9 +119,8 @@ void RemoteFileSystemOperation::Write(
path,
offset))));
- scoped_ptr<net::URLRequest> blob_request(
- new net::URLRequest(blob_url, file_writer_delegate_.get()));
- blob_request->set_context(url_request_context);
+ scoped_ptr<net::URLRequest> blob_request(new net::URLRequest(
+ blob_url, file_writer_delegate_.get(), url_request_context));
file_writer_delegate_->Start(blob_request.Pass());
}
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
index 751c861..db48d2e 100644
--- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
@@ -85,7 +85,9 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
void TestRequestHelper(const GURL& url, bool run_to_completion) {
delegate_.reset(new TestDelegate());
delegate_->set_quit_on_redirect(true);
- request_.reset(new net::URLRequest(url, delegate_.get()));
+ request_.reset(new net::URLRequest(url,
+ delegate_.get(),
+ &empty_context_));
job_ = new FileSystemDirURLRequestJob(request_.get(),
file_system_context_.get());
@@ -211,8 +213,9 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
scoped_refptr<base::MessageLoopProxy> file_thread_proxy_;
ScopedTempDir temp_dir_;
- scoped_ptr<net::URLRequest> request_;
+ net::URLRequestContext empty_context_;
scoped_ptr<TestDelegate> delegate_;
+ scoped_ptr<net::URLRequest> request_;
scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_;
scoped_refptr<FileSystemContext> file_system_context_;
base::WeakPtrFactory<FileSystemDirURLRequestJobTest> weak_factory_;
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index 5c77024..4265b6f 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -308,8 +308,9 @@ void FileSystemOperation::Write(
set_write_callback(callback);
scoped_ptr<net::URLRequest> blob_request(
- new net::URLRequest(blob_url, file_writer_delegate_.get()));
- blob_request->set_context(url_request_context);
+ new net::URLRequest(blob_url,
+ file_writer_delegate_.get(),
+ url_request_context));
file_writer_delegate_->Start(blob_request.Pass());
}
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc
index 1b713f9..c52dc94 100644
--- a/webkit/fileapi/file_system_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_url_request_job_unittest.cc
@@ -110,7 +110,8 @@ class FileSystemURLRequestJobTest : public testing::Test {
// Make delegate_ exit the MessageLoop when the request is done.
delegate_->set_quit_on_complete(true);
delegate_->set_quit_on_redirect(true);
- request_.reset(new net::URLRequest(url, delegate_.get()));
+ request_.reset(
+ new net::URLRequest(url, delegate_.get(), &empty_context_));
if (headers)
request_->SetExtraRequestHeaders(*headers);
ASSERT_TRUE(!job_);
@@ -209,6 +210,8 @@ class FileSystemURLRequestJobTest : public testing::Test {
scoped_refptr<FileSystemContext> file_system_context_;
base::WeakPtrFactory<FileSystemURLRequestJobTest> weak_factory_;
+ net::URLRequestContext empty_context_;
+
// NOTE: order matters, request must die before delegate
scoped_ptr<TestDelegate> delegate_;
scoped_ptr<net::URLRequest> request_;
diff --git a/webkit/fileapi/file_writer_delegate_unittest.cc b/webkit/fileapi/file_writer_delegate_unittest.cc
index d79f03d..676e719 100644
--- a/webkit/fileapi/file_writer_delegate_unittest.cc
+++ b/webkit/fileapi/file_writer_delegate_unittest.cc
@@ -12,6 +12,7 @@
#include "googleurl/src/gurl.h"
#include "net/base/io_buffer.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_job.h"
#include "net/url_request/url_request_status.h"
#include "testing/platform_test.h"
@@ -116,7 +117,9 @@ class FileWriterDelegateTest : public PlatformTest {
result_.reset(new Result());
file_writer_delegate_.reset(
CreateWriterDelegate("test", offset, allowed_growth, result_.get()));
- request_.reset(new net::URLRequest(blob_url, file_writer_delegate_.get()));
+ request_.reset(new net::URLRequest(blob_url,
+ file_writer_delegate_.get(),
+ &empty_context_));
}
static net::URLRequest::ProtocolFactory Factory;
@@ -124,6 +127,7 @@ class FileWriterDelegateTest : public PlatformTest {
// This should be alive until the very end of this instance.
MessageLoop loop_;
+ net::URLRequestContext empty_context_;
scoped_ptr<FileWriterDelegate> file_writer_delegate_;
scoped_ptr<net::URLRequest> request_;
scoped_ptr<Result> result_;
@@ -342,7 +346,9 @@ TEST_F(FileWriterDelegateTest, MAYBE_WriteSuccessWithoutQuotaLimitConcurrent) {
result2.reset(new Result());
file_writer_delegate2.reset(CreateWriterDelegate(
"test2", 0, quota::QuotaManager::kNoLimit, result2.get()));
- request2.reset(new net::URLRequest(kBlobURL2, file_writer_delegate2.get()));
+ request2.reset(new net::URLRequest(kBlobURL2,
+ file_writer_delegate2.get(),
+ &empty_context_));
ASSERT_EQ(0, test_helper_.GetCachedOriginUsage());
file_writer_delegate_->Start(request_.Pass());
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index f201ae4..f11f985 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -417,7 +417,7 @@ class RequestProxy
params->upload.get());
}
- request_.reset(new net::URLRequest(params->url, this));
+ request_.reset(new net::URLRequest(params->url, this, g_request_context));
request_->set_method(params->method);
request_->set_first_party_for_cookies(params->first_party_for_cookies);
request_->set_referrer(params->referrer.spec());
@@ -428,7 +428,6 @@ class RequestProxy
request_->SetExtraRequestHeaders(headers);
request_->set_load_flags(params->load_flags);
request_->set_upload(params->upload.get());
- request_->set_context(g_request_context);
SimpleAppCacheSystem::SetExtraRequestInfo(
request_.get(), params->appcache_host_id, params->request_type);