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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize to NULL Created 8 years, 7 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
« no previous file with comments | « chrome/browser/browsing_data_server_bound_cert_helper_unittest.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index 127d56137642bf6795f3dca8c00ae1ebafadc9e3..f2e94be246c4df285695ae7eb14e3b67bc3d374b 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -127,7 +127,7 @@ class ExtensionWebRequestTest : public testing::Test {
network_delegate_.reset(new ChromeNetworkDelegate(
event_router_.get(), NULL, NULL, &profile_,
CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_));
- context_ = new TestURLRequestContext();
+ context_.reset(new TestURLRequestContext());
context_->set_network_delegate(network_delegate_.get());
}
@@ -141,7 +141,7 @@ class ExtensionWebRequestTest : public testing::Test {
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
scoped_refptr<ExtensionInfoMap> extension_info_map_;
scoped_ptr<ChromeNetworkDelegate> network_delegate_;
- scoped_refptr<TestURLRequestContext> context_;
+ scoped_ptr<TestURLRequestContext> context_;
};
// Tests that we handle disagreements among extensions about responses to
@@ -166,7 +166,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) {
GURL not_chosen_redirect_url("about:not_chosen");
net::URLRequest request(GURL("about:blank"), &delegate_);
- request.set_context(context_);
+ request.set_context(context_.get());
{
// onBeforeRequest will be dispatched twice initially. The second response -
// the redirect - should win, since it has a later |install_time|. The
@@ -221,7 +221,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) {
// Now test the same thing but the extensions answer in reverse order.
net::URLRequest request2(GURL("about:blank"), &delegate_);
- request2.set_context(context_);
+ request2.set_context(context_.get());
{
ExtensionWebRequestEventRouter::EventResponse* response = NULL;
@@ -295,7 +295,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceCancel) {
GURL request_url("about:blank");
net::URLRequest request(request_url, &delegate_);
- request.set_context(context_);
+ request.set_context(context_.get());
// onBeforeRequest will be dispatched twice. The second response -
// the redirect - would win, since it has a later |install_time|, but
@@ -363,7 +363,7 @@ TEST_F(ExtensionWebRequestTest, SimulateChancelWhileBlocked) {
GURL request_url("about:blank");
net::URLRequest request(request_url, &delegate_);
- request.set_context(context_);
+ request.set_context(context_.get());
ExtensionWebRequestEventRouter::EventResponse* response = NULL;
@@ -444,7 +444,7 @@ class ExtensionWebRequestHeaderModificationTest :
network_delegate_.reset(new ChromeNetworkDelegate(
event_router_.get(), NULL, NULL, &profile_,
CookieSettings::Factory::GetForProfile(&profile_), &enable_referrers_));
- context_ = new TestURLRequestContext();
+ context_.reset(new TestURLRequestContext());
context_->set_network_delegate(network_delegate_.get());
}
@@ -458,7 +458,7 @@ class ExtensionWebRequestHeaderModificationTest :
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
scoped_refptr<ExtensionInfoMap> extension_info_map_;
scoped_ptr<ChromeNetworkDelegate> network_delegate_;
- scoped_refptr<TestURLRequestContext> context_;
+ scoped_ptr<TestURLRequestContext> context_;
};
TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) {
@@ -489,7 +489,7 @@ TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) {
GURL request_url("http://doesnotexist/does_not_exist.html");
net::URLRequest request(request_url, &delegate_);
- request.set_context(context_);
+ request.set_context(context_.get());
// Initialize headers available before extensions are notified of the
// onBeforeSendHeaders event.
« no previous file with comments | « chrome/browser/browsing_data_server_bound_cert_helper_unittest.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698