From b2eb23aa019b4713ae5cf453a570060ccb68a411 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 9 Jun 2015 09:51:38 +0800 Subject: [PATCH] Clean up code --- brightray/browser/net_log.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/brightray/browser/net_log.cc b/brightray/browser/net_log.cc index 6959ffbbe642..f8c54342dfb1 100644 --- a/brightray/browser/net_log.cc +++ b/brightray/browser/net_log.cc @@ -15,18 +15,17 @@ namespace { -base::Value* GetConstants() { +scoped_ptr GetConstants() { scoped_ptr constants = net::GetNetConstants(); // Adding client information to constants dictionary. base::DictionaryValue* client_info = new base::DictionaryValue(); - - client_info->SetString("command_line", + client_info->SetString( + "command_line", base::CommandLine::ForCurrentProcess()->GetCommandLineString()); constants->Set("clientInfo", client_info); - - return constants.release(); + return constants; } } // namespace @@ -51,7 +50,7 @@ NetLog::NetLog(net::URLRequestContext* context) << "for net logging"; } else { std::string json; - scoped_ptr constants(GetConstants()); + scoped_ptr constants(GetConstants().Pass()); base::JSONWriter::Write(constants.get(), &json); fprintf(log_file_.get(), "{\"constants\": %s, \n", json.c_str()); fprintf(log_file_.get(), "\"events\": [\n");