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

Side by Side Diff: net/disk_cache/backend_impl.cc

Issue 6613027: Adds memory cache logging, and updates disk cache logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Oops Created 9 years, 9 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/base/net_log_source_type_list.h ('k') | net/disk_cache/backend_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // ------------------------------------------------------------------------ 288 // ------------------------------------------------------------------------
289 289
290 namespace disk_cache { 290 namespace disk_cache {
291 291
292 int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes, 292 int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes,
293 bool force, base::MessageLoopProxy* thread, 293 bool force, base::MessageLoopProxy* thread,
294 net::NetLog* net_log, Backend** backend, 294 net::NetLog* net_log, Backend** backend,
295 CompletionCallback* callback) { 295 CompletionCallback* callback) {
296 DCHECK(callback); 296 DCHECK(callback);
297 if (type == net::MEMORY_CACHE) { 297 if (type == net::MEMORY_CACHE) {
298 *backend = MemBackendImpl::CreateBackend(max_bytes); 298 *backend = MemBackendImpl::CreateBackend(max_bytes, net_log);
299 return *backend ? net::OK : net::ERR_FAILED; 299 return *backend ? net::OK : net::ERR_FAILED;
300 } 300 }
301 DCHECK(thread); 301 DCHECK(thread);
302 302
303 return BackendImpl::CreateBackend(path, force, max_bytes, type, kNone, thread, 303 return BackendImpl::CreateBackend(path, force, max_bytes, type, kNone, thread,
304 net_log, backend, callback); 304 net_log, backend, callback);
305 } 305 }
306 306
307 // Returns the preferred maximum number of bytes for the cache given the 307 // Returns the preferred maximum number of bytes for the cache given the
308 // number of available bytes. 308 // number of available bytes.
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2077 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2078 total_memory = kMaxBuffersSize; 2078 total_memory = kMaxBuffersSize;
2079 2079
2080 done = true; 2080 done = true;
2081 } 2081 }
2082 2082
2083 return static_cast<int>(total_memory); 2083 return static_cast<int>(total_memory);
2084 } 2084 }
2085 2085
2086 } // namespace disk_cache 2086 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/base/net_log_source_type_list.h ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698