Index: chromecast/browser/cast_net_log.cc |
diff --git a/content/shell/browser/shell_net_log.cc b/chromecast/browser/cast_net_log.cc |
similarity index 79% |
copy from content/shell/browser/shell_net_log.cc |
copy to chromecast/browser/cast_net_log.cc |
index 2a21b8ebfe352a093847ead52fbe5b36c01318c4..36147f3449125c0c7185d07d7946279f32024e54 100644 |
--- a/content/shell/browser/shell_net_log.cc |
+++ b/chromecast/browser/cast_net_log.cc |
@@ -1,8 +1,8 @@ |
-// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "content/shell/browser/shell_net_log.h" |
+#include "chromecast/browser/cast_net_log.h" |
#include <stdio.h> |
@@ -14,17 +14,17 @@ |
#include "net/log/net_log_util.h" |
#include "net/log/write_to_file_net_log_observer.h" |
-namespace content { |
+namespace chromecast { |
namespace { |
-base::DictionaryValue* GetShellConstants(const std::string& app_name) { |
+base::DictionaryValue* GetShellConstants() { |
scoped_ptr<base::DictionaryValue> constants_dict = net::GetNetConstants(); |
// Add a dictionary with client information |
base::DictionaryValue* dict = new base::DictionaryValue(); |
- dict->SetString("name", app_name); |
+ dict->SetString("name", "cast_shell"); |
dict->SetString( |
"command_line", |
base::CommandLine::ForCurrentProcess()->GetCommandLineString()); |
@@ -36,9 +36,9 @@ base::DictionaryValue* GetShellConstants(const std::string& app_name) { |
} // namespace |
-ShellNetLog::ShellNetLog(const std::string& app_name) { |
- // TODO(mmenke): Other than a different set of constants, this code is |
- // identical to code in ChromeNetLog. Consider merging the code. |
+CastNetLog::CastNetLog() { |
+ // TODO(derekjchow): This code is virtually identical to ShellNetLog which is |
+ // nearly identical to code in ChromeNetLog. Consider merging the code. |
const base::CommandLine* command_line = |
base::CommandLine::ForCurrentProcess(); |
@@ -62,7 +62,7 @@ ShellNetLog::ShellNetLog(const std::string& app_name) { |
LOG(ERROR) << "Could not open file " << log_path.value() |
<< " for net logging"; |
} else { |
- scoped_ptr<base::Value> constants(GetShellConstants(app_name)); |
+ scoped_ptr<base::Value> constants(GetShellConstants()); |
write_to_file_observer_.reset(new net::WriteToFileNetLogObserver()); |
write_to_file_observer_->StartObserving(this, file.Pass(), |
constants.get(), nullptr); |
@@ -70,10 +70,10 @@ ShellNetLog::ShellNetLog(const std::string& app_name) { |
} |
} |
-ShellNetLog::~ShellNetLog() { |
+CastNetLog::~CastNetLog() { |
// Remove the observer we own before we're destroyed. |
if (write_to_file_observer_) |
write_to_file_observer_->StopObserving(nullptr); |
} |
-} // namespace content |
+} // namespace chromecast |