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" | |
14 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
15 #include "net/base/cache_type.h" | 14 #include "net/base/cache_type.h" |
16 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
17 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
18 #include "net/disk_cache/disk_cache.h" | 17 #include "net/disk_cache/disk_cache.h" |
19 #include "net/tools/dump_cache/cache_dumper.h" | 18 #include "net/tools/dump_cache/cache_dumper.h" |
20 | 19 |
21 namespace net { | 20 namespace net { |
22 | 21 |
23 SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, | 22 SimpleCacheDumper::SimpleCacheDumper(base::FilePath input_path, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 src_entry_->Close(); | 253 src_entry_->Close(); |
255 writer_->CloseEntry(dst_entry_, base::Time::Now(), base::Time::Now()); | 254 writer_->CloseEntry(dst_entry_, base::Time::Now(), base::Time::Now()); |
256 src_entry_ = NULL; | 255 src_entry_ = NULL; |
257 dst_entry_ = NULL; | 256 dst_entry_ = NULL; |
258 | 257 |
259 state_ = STATE_OPEN_ENTRY; | 258 state_ = STATE_OPEN_ENTRY; |
260 return OK; | 259 return OK; |
261 } | 260 } |
262 | 261 |
263 void SimpleCacheDumper::OnIOComplete(int rv) { | 262 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 | |
269 rv = DoLoop(rv); | 263 rv = DoLoop(rv); |
270 | 264 |
271 if (rv != ERR_IO_PENDING) { | 265 if (rv != ERR_IO_PENDING) { |
272 rv_ = rv; | 266 rv_ = rv; |
273 cache_.reset(); | 267 cache_.reset(); |
274 base::MessageLoop::current()->Quit(); | 268 base::MessageLoop::current()->Quit(); |
275 } | 269 } |
276 } | 270 } |
277 | 271 |
278 } // namespace net | 272 } // namespace net |
OLD | NEW |