OLD | NEW |
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 "net/tools/dump_cache/simple_cache_dumper.h" | 5 #include "net/tools/dump_cache/simple_cache_dumper.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 13 #include "base/profiler/scoped_tracker.h" |
13 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
14 #include "net/base/cache_type.h" | 15 #include "net/base/cache_type.h" |
15 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
17 #include "net/disk_cache/disk_cache.h" | 18 #include "net/disk_cache/disk_cache.h" |
18 #include "net/tools/dump_cache/cache_dumper.h" | 19 #include "net/tools/dump_cache/cache_dumper.h" |
19 | 20 |
20 namespace net { | 21 namespace net { |
21 | 22 |
22 SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, | 23 SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 src_entry_->Close(); | 254 src_entry_->Close(); |
254 writer_->CloseEntry(dst_entry_, base::Time::Now(), base::Time::Now()); | 255 writer_->CloseEntry(dst_entry_, base::Time::Now(), base::Time::Now()); |
255 src_entry_ = NULL; | 256 src_entry_ = NULL; |
256 dst_entry_ = NULL; | 257 dst_entry_ = NULL; |
257 | 258 |
258 state_ = STATE_OPEN_ENTRY; | 259 state_ = STATE_OPEN_ENTRY; |
259 return OK; | 260 return OK; |
260 } | 261 } |
261 | 262 |
262 void SimpleCacheDumper::OnIOComplete(int rv) { | 263 void SimpleCacheDumper::OnIOComplete(int rv) { |
| 264 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
| 265 tracked_objects::ScopedTracker tracking_profile( |
| 266 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 267 "422516 SimpleCacheDumper::OnIOComplete")); |
| 268 |
263 rv = DoLoop(rv); | 269 rv = DoLoop(rv); |
264 | 270 |
265 if (rv != ERR_IO_PENDING) { | 271 if (rv != ERR_IO_PENDING) { |
266 rv_ = rv; | 272 rv_ = rv; |
267 cache_.reset(); | 273 cache_.reset(); |
268 base::MessageLoop::current()->Quit(); | 274 base::MessageLoop::current()->Quit(); |
269 } | 275 } |
270 } | 276 } |
271 | 277 |
272 } // namespace net | 278 } // namespace net |
OLD | NEW |