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

Unified Diff: content/browser/loader/redirect_to_file_resource_handler.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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
Index: content/browser/loader/redirect_to_file_resource_handler.cc
diff --git a/content/browser/loader/redirect_to_file_resource_handler.cc b/content/browser/loader/redirect_to_file_resource_handler.cc
index 12bd9793107100ca3b8b76f428774f69c5a72930..41168c5437bdbe7466d15c93c502eb51da541df6 100644
--- a/content/browser/loader/redirect_to_file_resource_handler.cc
+++ b/content/browser/loader/redirect_to_file_resource_handler.cc
@@ -79,7 +79,7 @@ bool RedirectToFileResourceHandler::OnResponseStarted(
bool* defer) {
if (response->head.error_code == net::OK ||
response->head.error_code == net::ERR_IO_PENDING) {
- DCHECK(deletable_file_ && !deletable_file_->path().empty());
+ DCHECK(deletable_file_.get() && !deletable_file_->path().empty());
response->head.download_file_path = deletable_file_->path();
}
return next_handler_->OnResponseStarted(request_id, response, defer);
@@ -89,7 +89,7 @@ bool RedirectToFileResourceHandler::OnWillStart(int request_id,
const GURL& url,
bool* defer) {
request_id_ = request_id;
- if (!deletable_file_) {
+ if (!deletable_file_.get()) {
// Defer starting the request until we have created the temporary file.
// TODO(darin): This is sub-optimal. We should not delay starting the
// network request like this.
@@ -116,7 +116,7 @@ bool RedirectToFileResourceHandler::OnWillRead(int request_id,
// We should have paused this network request already if the buffer is full.
DCHECK(!BufIsFull());
- *buf = buf_;
+ *buf = buf_.get();
*buf_size = buf_->RemainingCapacity();
buf_write_pending_ = true;
@@ -231,11 +231,11 @@ bool RedirectToFileResourceHandler::WriteMore() {
// bowels of its implementation, the use of scoped_refptr here is not
// spurious.
scoped_refptr<DependentIOBuffer> wrapped = new DependentIOBuffer(
- buf_, buf_->StartOfBuffer() + write_cursor_);
+ buf_.get(), buf_->StartOfBuffer() + write_cursor_);
int write_len = buf_->offset() - write_cursor_;
int rv = file_stream_->Write(
- wrapped,
+ wrapped.get(),
write_len,
base::Bind(&RedirectToFileResourceHandler::DidWriteToFile,
base::Unretained(this)));
« no previous file with comments | « content/browser/loader/cross_site_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698