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

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

Issue 1369703002: Remove traces of TracingCacheBackend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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) 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "net/base/cache_type.h" 9 #include "net/base/cache_type.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 int rv = new_cache->Init( 115 int rv = new_cache->Init(
116 base::Bind(&CacheCreator::OnIOComplete, base::Unretained(this))); 116 base::Bind(&CacheCreator::OnIOComplete, base::Unretained(this)));
117 DCHECK_EQ(net::ERR_IO_PENDING, rv); 117 DCHECK_EQ(net::ERR_IO_PENDING, rv);
118 return rv; 118 return rv;
119 #endif 119 #endif
120 } 120 }
121 121
122 void CacheCreator::DoCallback(int result) { 122 void CacheCreator::DoCallback(int result) {
123 DCHECK_NE(net::ERR_IO_PENDING, result); 123 DCHECK_NE(net::ERR_IO_PENDING, result);
124 if (result == net::OK) { 124 if (result == net::OK) {
125 #ifndef USE_TRACING_CACHE_BACKEND
126 *backend_ = created_cache_.Pass(); 125 *backend_ = created_cache_.Pass();
127 #else
128 *backend_.reset(
129 new disk_cache::TracingCacheBackend(created_cache_.Pass()));
130 #endif
131 } else { 126 } else {
132 LOG(ERROR) << "Unable to create cache"; 127 LOG(ERROR) << "Unable to create cache";
133 created_cache_.reset(); 128 created_cache_.reset();
134 } 129 }
135 callback_.Run(result); 130 callback_.Run(result);
136 delete this; 131 delete this;
137 } 132 }
138 133
139 // If the initialization of the cache fails, and |force| is true, we will 134 // If the initialization of the cache fails, and |force| is true, we will
140 // discard the whole cache and create a new one. 135 // discard the whole cache and create a new one.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 backend_type, 177 backend_type,
183 kNone, 178 kNone,
184 thread, 179 thread,
185 net_log, 180 net_log,
186 backend, 181 backend,
187 callback); 182 callback);
188 return creator->Run(); 183 return creator->Run();
189 } 184 }
190 185
191 } // namespace disk_cache 186 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698