| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 base::Unretained(this))), | 33 base::Unretained(this))), |
| 34 rv_(0) { | 34 rv_(0) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 SimpleCacheDumper::~SimpleCacheDumper() { | 37 SimpleCacheDumper::~SimpleCacheDumper() { |
| 38 } | 38 } |
| 39 | 39 |
| 40 int SimpleCacheDumper::Run() { | 40 int SimpleCacheDumper::Run() { |
| 41 base::MessageLoopForIO main_message_loop; | 41 base::MessageLoopForIO main_message_loop; |
| 42 | 42 |
| 43 LOG(INFO) << "Reading cache from: " << input_path_.value(); | 43 VLOG(0) << "Reading cache from: " << input_path_.value(); |
| 44 LOG(INFO) << "Writing cache to: " << output_path_.value(); | 44 VLOG(0) << "Writing cache to: " << output_path_.value(); |
| 45 | 45 |
| 46 if (!cache_thread_->StartWithOptions( | 46 if (!cache_thread_->StartWithOptions( |
| 47 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))) { | 47 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))) { |
| 48 LOG(ERROR) << "Unable to start thread"; | 48 LOG(ERROR) << "Unable to start thread"; |
| 49 return ERR_UNEXPECTED; | 49 return ERR_UNEXPECTED; |
| 50 } | 50 } |
| 51 state_ = STATE_CREATE_CACHE; | 51 state_ = STATE_CREATE_CACHE; |
| 52 int rv = DoLoop(OK); | 52 int rv = DoLoop(OK); |
| 53 if (rv == ERR_IO_PENDING) { | 53 if (rv == ERR_IO_PENDING) { |
| 54 main_message_loop.Run(); | 54 main_message_loop.Run(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 rv = DoLoop(rv); | 264 rv = DoLoop(rv); |
| 265 | 265 |
| 266 if (rv != ERR_IO_PENDING) { | 266 if (rv != ERR_IO_PENDING) { |
| 267 rv_ = rv; | 267 rv_ = rv; |
| 268 cache_.reset(); | 268 cache_.reset(); |
| 269 base::MessageLoop::current()->Quit(); | 269 base::MessageLoop::current()->Quit(); |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace net | 273 } // namespace net |
| OLD | NEW |