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

Unified Diff: net/disk_cache/sparse_control.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 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
« no previous file with comments | « net/disk_cache/mem_entry_impl.cc ('k') | net/disk_cache/stats_histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/sparse_control.cc
diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc
index e94a1bc9abd7b1296aab443dae751c9acafe068e..32f44ab98a02dd524ee288350fe35f6a8f2184aa 100644
--- a/net/disk_cache/sparse_control.cc
+++ b/net/disk_cache/sparse_control.cc
@@ -319,8 +319,8 @@ int SparseControl::CreateSparseEntry() {
children_map_.Resize(kNumSparseBits, true);
// Save the header. The bitmap is saved in the destructor.
- scoped_refptr<net::IOBuffer> buf =
- new net::WrappedIOBuffer(reinterpret_cast<char*>(&sparse_header_));
+ scoped_refptr<net::IOBuffer> buf(
+ new net::WrappedIOBuffer(reinterpret_cast<char*>(&sparse_header_)));
int rv = entry_->WriteData(kSparseIndex, 0, buf, sizeof(sparse_header_), NULL,
false);
@@ -349,8 +349,8 @@ int SparseControl::OpenSparseEntry(int data_len) {
if (map_len > kMaxMapSize || map_len % 4)
return net::ERR_CACHE_OPERATION_NOT_SUPPORTED;
- scoped_refptr<net::IOBuffer> buf =
- new net::WrappedIOBuffer(reinterpret_cast<char*>(&sparse_header_));
+ scoped_refptr<net::IOBuffer> buf(
+ new net::WrappedIOBuffer(reinterpret_cast<char*>(&sparse_header_)));
// Read header.
int rv = entry_->ReadData(kSparseIndex, 0, buf, sizeof(sparse_header_), NULL);
@@ -402,8 +402,8 @@ bool SparseControl::OpenChild() {
static_cast<int>(sizeof(child_data_)))
return KillChildAndContinue(key, false);
- scoped_refptr<net::WrappedIOBuffer> buf =
- new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_));
+ scoped_refptr<net::WrappedIOBuffer> buf(
+ new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_)));
// Read signature.
int rv = child_->ReadData(kSparseIndex, 0, buf, sizeof(child_data_), NULL);
@@ -425,8 +425,8 @@ bool SparseControl::OpenChild() {
}
void SparseControl::CloseChild() {
- scoped_refptr<net::WrappedIOBuffer> buf =
- new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_));
+ scoped_refptr<net::WrappedIOBuffer> buf(
+ new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_)));
// Save the allocation bitmap before closing the child entry.
int rv = child_->WriteData(kSparseIndex, 0, buf, sizeof(child_data_),
@@ -492,8 +492,8 @@ void SparseControl::SetChildBit(bool value) {
}
void SparseControl::WriteSparseData() {
- scoped_refptr<net::IOBuffer> buf = new net::WrappedIOBuffer(
- reinterpret_cast<const char*>(children_map_.GetMap()));
+ scoped_refptr<net::IOBuffer> buf(new net::WrappedIOBuffer(
+ reinterpret_cast<const char*>(children_map_.GetMap())));
int len = children_map_.ArraySize() * 4;
int rv = entry_->WriteData(kSparseIndex, sizeof(sparse_header_), buf, len,
@@ -597,8 +597,8 @@ void SparseControl::InitChildData() {
memset(&child_data_, 0, sizeof(child_data_));
child_data_.header = sparse_header_;
- scoped_refptr<net::WrappedIOBuffer> buf =
- new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_));
+ scoped_refptr<net::WrappedIOBuffer> buf(
+ new net::WrappedIOBuffer(reinterpret_cast<char*>(&child_data_)));
int rv = child_->WriteData(kSparseIndex, 0, buf, sizeof(child_data_),
NULL, false);
« no previous file with comments | « net/disk_cache/mem_entry_impl.cc ('k') | net/disk_cache/stats_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698