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

Unified Diff: content/browser/renderer_host/resource_loader.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 2 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: content/browser/renderer_host/resource_loader.cc
diff --git a/content/browser/renderer_host/resource_loader.cc b/content/browser/renderer_host/resource_loader.cc
index be893d7c97440ff2068932fe1b17f50374fdd48b..e8c8a538592eb84cafa82344c2ba97017074c712 100644
--- a/content/browser/renderer_host/resource_loader.cc
+++ b/content/browser/renderer_host/resource_loader.cc
@@ -66,9 +66,9 @@ ResourceLoader::ResourceLoader(scoped_ptr<net::URLRequest> request,
}
ResourceLoader::~ResourceLoader() {
- if (login_delegate_)
+ if (login_delegate_.get())
login_delegate_->OnRequestCancelled();
- if (ssl_client_auth_handler_)
+ if (ssl_client_auth_handler_.get())
ssl_client_auth_handler_->OnRequestCancelled();
// Run ResourceHandler destructor before we tear-down the rest of our state
@@ -220,10 +220,12 @@ void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused,
}
scoped_refptr<ResourceResponse> response(new ResourceResponse());
- PopulateResourceResponse(request_.get(), response);
+ PopulateResourceResponse(request_.get(), response.get());
- if (!handler_->OnRequestRedirected(info->GetRequestID(), new_url, response,
- defer)) {
+ if (
+ !handler_->
+ OnRequestRedirected(info->GetRequestID(), new_url, response.get(),
+ defer)) {
Cancel();
} else if (*defer) {
deferred_stage_ = DEFERRED_REDIRECT; // Follow redirect when resumed.
@@ -247,10 +249,10 @@ void ResourceLoader::OnAuthRequired(net::URLRequest* unused,
// Create a login dialog on the UI thread to get authentication data, or pull
// from cache and continue on the IO thread.
- DCHECK(!login_delegate_) <<
+ DCHECK(!login_delegate_.get()) <<
"OnAuthRequired called with login_delegate pending";
login_delegate_ = delegate_->CreateLoginDelegate(this, auth_info);
- if (!login_delegate_)
+ if (!login_delegate_.get())
request_->CancelAuth();
}
@@ -270,7 +272,7 @@ void ResourceLoader::OnCertificateRequested(
return;
}
- DCHECK(!ssl_client_auth_handler_) <<
+ DCHECK(!ssl_client_auth_handler_.get()) <<
"OnCertificateRequested called with ssl_client_auth_handler pending";
ssl_client_auth_handler_ = new SSLClientAuthHandler(request_.get(),
cert_info);
@@ -432,11 +434,11 @@ void ResourceLoader::CancelRequestInternal(int error, bool from_renderer) {
// IO_PENDING?
bool was_pending = request_->is_pending();
- if (login_delegate_) {
+ if (login_delegate_.get()) {
login_delegate_->OnRequestCancelled();
login_delegate_ = NULL;
}
- if (ssl_client_auth_handler_) {
+ if (ssl_client_auth_handler_.get()) {
ssl_client_auth_handler_->OnRequestCancelled();
ssl_client_auth_handler_ = NULL;
}
@@ -457,11 +459,11 @@ void ResourceLoader::CompleteResponseStarted() {
ResourceRequestInfoImpl* info = GetRequestInfo();
scoped_refptr<ResourceResponse> response(new ResourceResponse());
- PopulateResourceResponse(request_.get(), response);
+ PopulateResourceResponse(request_.get(), response.get());
- if (request_->ssl_info().cert) {
+ if (request_->ssl_info().cert.get()) {
int cert_id =
- CertStore::GetInstance()->StoreCert(request_->ssl_info().cert,
+ CertStore::GetInstance()->StoreCert(request_->ssl_info().cert.get(),
info->GetChildID());
response->head.security_info = SerializeSecurityInfo(
cert_id,
@@ -478,7 +480,9 @@ void ResourceLoader::CompleteResponseStarted() {
delegate_->DidReceiveResponse(this);
bool defer = false;
- if (!handler_->OnResponseStarted(info->GetRequestID(), response, &defer)) {
+ if (
+ !handler_->
+ OnResponseStarted(info->GetRequestID(), response.get(), &defer)) {
Cancel();
} else if (defer) {
deferred_stage_ = DEFERRED_READ; // Read first chunk when resumed.
@@ -556,8 +560,8 @@ void ResourceLoader::ResponseCompleted() {
std::string security_info;
const net::SSLInfo& ssl_info = request_->ssl_info();
- if (ssl_info.cert != NULL) {
- int cert_id = CertStore::GetInstance()->StoreCert(ssl_info.cert,
+ if (ssl_info.cert.get() != NULL) {
+ int cert_id = CertStore::GetInstance()->StoreCert(ssl_info.cert.get(),
info->GetChildID());
security_info = SerializeSecurityInfo(
cert_id, ssl_info.cert_status, ssl_info.security_bits,
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698