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

Side by Side Diff: webkit/browser/blob/local_file_stream_reader.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/browser/blob/local_file_stream_reader.h" 5 #include "webkit/browser/blob/local_file_stream_reader.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_util_proxy.h" 8 #include "base/files/file_util_proxy.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (stream_impl_) 53 if (stream_impl_)
54 return stream_impl_->Read(buf, buf_len, callback); 54 return stream_impl_->Read(buf, buf_len, callback);
55 return Open(base::Bind(&LocalFileStreamReader::DidOpenForRead, 55 return Open(base::Bind(&LocalFileStreamReader::DidOpenForRead,
56 weak_factory_.GetWeakPtr(), 56 weak_factory_.GetWeakPtr(),
57 make_scoped_refptr(buf), buf_len, callback)); 57 make_scoped_refptr(buf), buf_len, callback));
58 } 58 }
59 59
60 int64 LocalFileStreamReader::GetLength( 60 int64 LocalFileStreamReader::GetLength(
61 const net::Int64CompletionCallback& callback) { 61 const net::Int64CompletionCallback& callback) {
62 const bool posted = base::FileUtilProxy::GetFileInfo( 62 const bool posted = base::FileUtilProxy::GetFileInfo(
63 task_runner_, file_path_, 63 task_runner_.get(),
64 file_path_,
64 base::Bind(&LocalFileStreamReader::DidGetFileInfoForGetLength, 65 base::Bind(&LocalFileStreamReader::DidGetFileInfoForGetLength,
65 weak_factory_.GetWeakPtr(), callback)); 66 weak_factory_.GetWeakPtr(),
67 callback));
66 DCHECK(posted); 68 DCHECK(posted);
67 return net::ERR_IO_PENDING; 69 return net::ERR_IO_PENDING;
68 } 70 }
69 71
70 int LocalFileStreamReader::Open(const net::CompletionCallback& callback) { 72 int LocalFileStreamReader::Open(const net::CompletionCallback& callback) {
71 DCHECK(!has_pending_open_); 73 DCHECK(!has_pending_open_);
72 DCHECK(!stream_impl_.get()); 74 DCHECK(!stream_impl_.get());
73 has_pending_open_ = true; 75 has_pending_open_ = true;
74 76
75 // Call GetLength first to make it perform last-modified-time verification, 77 // Call GetLength first to make it perform last-modified-time verification,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 return; 160 return;
159 } 161 }
160 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { 162 if (!VerifySnapshotTime(expected_modification_time_, file_info)) {
161 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); 163 callback.Run(net::ERR_UPLOAD_FILE_CHANGED);
162 return; 164 return;
163 } 165 }
164 callback.Run(file_info.size); 166 callback.Run(file_info.size);
165 } 167 }
166 168
167 } // namespace webkit_blob 169 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/blob/blob_url_request_job_unittest.cc ('k') | webkit/browser/blob/local_file_stream_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698