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

Side by Side Diff: net/disk_cache/simple/simple_backend_impl.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_index_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/disk_cache/simple/simple_backend_impl.h" 5 #include "net/disk_cache/simple/simple_backend_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (result == net::OK) 126 if (result == net::OK)
127 UMA_HISTOGRAM_TIMES("SimpleCache.CreationToIndex", creation_to_index); 127 UMA_HISTOGRAM_TIMES("SimpleCache.CreationToIndex", creation_to_index);
128 else 128 else
129 UMA_HISTOGRAM_TIMES("SimpleCache.CreationToIndexFail", creation_to_index); 129 UMA_HISTOGRAM_TIMES("SimpleCache.CreationToIndexFail", creation_to_index);
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 133
134 namespace disk_cache { 134 namespace disk_cache {
135 135
136 SimpleBackendImpl::SimpleBackendImpl( 136 SimpleBackendImpl::SimpleBackendImpl(const FilePath& path,
137 const FilePath& path, 137 int max_bytes,
138 int max_bytes, 138 net::CacheType type,
139 net::CacheType type, 139 base::SingleThreadTaskRunner* cache_thread,
140 base::SingleThreadTaskRunner* cache_thread, 140 net::NetLog* net_log)
141 net::NetLog* net_log)
142 : path_(path), 141 : path_(path),
143 index_(new SimpleIndex(MessageLoopProxy::current(), // io_thread 142 index_(new SimpleIndex(MessageLoopProxy::current(), // io_thread
144 path, 143 path,
145 scoped_ptr<SimpleIndexFile>( 144 scoped_ptr<SimpleIndexFile>(
146 new SimpleIndexFile(cache_thread, path)))), 145 new SimpleIndexFile(cache_thread, path)))),
147 cache_thread_(cache_thread), 146 cache_thread_(cache_thread),
148 orig_max_size_(max_bytes) { 147 orig_max_size_(max_bytes) {
149 index_->ExecuteWhenReady(base::Bind(&RecordIndexLoad, 148 index_->ExecuteWhenReady(base::Bind(&RecordIndexLoad,
150 base::TimeTicks::Now())); 149 base::TimeTicks::Now()));
151 } 150 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // currently active entry. 344 // currently active entry.
346 if (key != it->second->key()) { 345 if (key != it->second->key()) {
347 it->second->Doom(); 346 it->second->Doom();
348 DCHECK_EQ(0U, active_entries_.count(entry_hash)); 347 DCHECK_EQ(0U, active_entries_.count(entry_hash));
349 return CreateOrFindActiveEntry(key); 348 return CreateOrFindActiveEntry(key);
350 } 349 }
351 return make_scoped_refptr(it->second.get()); 350 return make_scoped_refptr(it->second.get());
352 } 351 }
353 352
354 } // namespace disk_cache 353 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_index_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698