Merge pull request #140 from deepak1556/net_log_patch
create net log file after context is created
This commit is contained in:
commit
9d7fbdfd8e
1 changed files with 10 additions and 9 deletions
|
@ -30,6 +30,12 @@ scoped_ptr<base::DictionaryValue> GetConstants() {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NetLog::NetLog() {
|
NetLog::NetLog() {
|
||||||
|
}
|
||||||
|
|
||||||
|
NetLog::~NetLog() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetLog::StartLogging(net::URLRequestContext* url_request_context) {
|
||||||
auto command_line = base::CommandLine::ForCurrentProcess();
|
auto command_line = base::CommandLine::ForCurrentProcess();
|
||||||
if (!command_line->HasSwitch(switches::kLogNetLog))
|
if (!command_line->HasSwitch(switches::kLogNetLog))
|
||||||
return;
|
return;
|
||||||
|
@ -46,17 +52,12 @@ NetLog::NetLog() {
|
||||||
<< "for net logging";
|
<< "for net logging";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NetLog::~NetLog() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetLog::StartLogging(net::URLRequestContext* url_request_context) {
|
|
||||||
if (!log_file_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
scoped_ptr<base::Value> constants(GetConstants());
|
scoped_ptr<base::Value> constants(GetConstants());
|
||||||
write_to_file_observer_.StartObserving(this, log_file_.Pass(), constants.get(), url_request_context);
|
write_to_file_observer_.StartObserving(this,
|
||||||
|
log_file_.Pass(),
|
||||||
|
constants.get(),
|
||||||
|
url_request_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace brightray
|
} // namespace brightray
|
||||||
|
|
Loading…
Reference in a new issue