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

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

Issue 1062413002: Remove unnecessary instrumentation for several jank bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 8 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 | « net/disk_cache/blockfile/in_flight_io.cc ('k') | net/dns/host_resolver_impl.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) 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/profiler/scoped_tracker.h"
8 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
9 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
10 #include "net/base/cache_type.h" 9 #include "net/base/cache_type.h"
11 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
12 #include "net/disk_cache/blockfile/backend_impl.h" 11 #include "net/disk_cache/blockfile/backend_impl.h"
13 #include "net/disk_cache/cache_util.h" 12 #include "net/disk_cache/cache_util.h"
14 #include "net/disk_cache/disk_cache.h" 13 #include "net/disk_cache/disk_cache.h"
15 #include "net/disk_cache/memory/mem_backend_impl.h" 14 #include "net/disk_cache/memory/mem_backend_impl.h"
16 #include "net/disk_cache/simple/simple_backend_impl.h" 15 #include "net/disk_cache/simple/simple_backend_impl.h"
17 16
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 LOG(ERROR) << "Unable to create cache"; 132 LOG(ERROR) << "Unable to create cache";
134 created_cache_.reset(); 133 created_cache_.reset();
135 } 134 }
136 callback_.Run(result); 135 callback_.Run(result);
137 delete this; 136 delete this;
138 } 137 }
139 138
140 // If the initialization of the cache fails, and |force| is true, we will 139 // If the initialization of the cache fails, and |force| is true, we will
141 // discard the whole cache and create a new one. 140 // discard the whole cache and create a new one.
142 void CacheCreator::OnIOComplete(int result) { 141 void CacheCreator::OnIOComplete(int result) {
143 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
144 tracked_objects::ScopedTracker tracking_profile(
145 FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 CacheCreator::OnIOComplete"));
146
147 if (result == net::OK || !force_ || retry_) 142 if (result == net::OK || !force_ || retry_)
148 return DoCallback(result); 143 return DoCallback(result);
149 144
150 // This is a failure and we are supposed to try again, so delete the object, 145 // This is a failure and we are supposed to try again, so delete the object,
151 // delete all the files, and try again. 146 // delete all the files, and try again.
152 retry_ = true; 147 retry_ = true;
153 created_cache_.reset(); 148 created_cache_.reset();
154 if (!disk_cache::DelayedCacheCleanup(path_)) 149 if (!disk_cache::DelayedCacheCleanup(path_))
155 return DoCallback(result); 150 return DoCallback(result);
156 151
(...skipping 30 matching lines...) Expand all
187 backend_type, 182 backend_type,
188 kNone, 183 kNone,
189 thread, 184 thread,
190 net_log, 185 net_log,
191 backend, 186 backend,
192 callback); 187 callback);
193 return creator->Run(); 188 return creator->Run();
194 } 189 }
195 190
196 } // namespace disk_cache 191 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/in_flight_io.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698