summaryrefslogtreecommitdiffstats
path: root/net/tools/gdig/gdig.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tools/gdig/gdig.cc')
-rw-r--r--net/tools/gdig/gdig.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/tools/gdig/gdig.cc b/net/tools/gdig/gdig.cc
index 1640408..7cbb9a4 100644
--- a/net/tools/gdig/gdig.cc
+++ b/net/tools/gdig/gdig.cc
@@ -182,6 +182,7 @@ bool LoadReplayLog(const base::FilePath& file_path, ReplayLog* replay_log) {
class GDig {
public:
GDig();
+ ~GDig();
enum Result {
RESULT_NO_RESOLVE = -3,
@@ -219,7 +220,8 @@ class GDig {
base::CancelableClosure timeout_closure_;
scoped_ptr<DnsConfigService> dns_config_service_;
- scoped_ptr<FileNetLog> log_;
+ scoped_ptr<FileNetLogObserver> log_observer_;
+ scoped_ptr<NetLog> log_;
scoped_ptr<HostResolver> resolver_;
};
@@ -232,6 +234,11 @@ GDig::GDig()
active_resolves_(0) {
}
+GDig::~GDig() {
+ if (log_)
+ log_->RemoveThreadSafeObserver(log_observer_.get());
+}
+
GDig::Result GDig::Main(int argc, const char* argv[]) {
if (!ParseCommandLine(argc, argv)) {
fprintf(stderr,
@@ -299,7 +306,9 @@ bool GDig::ParseCommandLine(int argc, const char* argv[]) {
return false;
}
}
- log_.reset(new FileNetLog(stderr, level));
+ log_.reset(new NetLog);
+ log_observer_.reset(new FileNetLogObserver(stderr));
+ log_->AddThreadSafeObserver(log_observer_.get(), level);
}
print_config_ = parsed_command_line.HasSwitch("print_config");