Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: content/shell/shell_net_log.cc

Issue 23316003: [content shell] move browser process stuff into browser/ subdir (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/shell_net_log.h ('k') | content/shell/shell_network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_net_log.cc
diff --git a/content/shell/shell_net_log.cc b/content/shell/shell_net_log.cc
deleted file mode 100644
index 03443d2e3ae273c42590450b875b5a81255a3901..0000000000000000000000000000000000000000
--- a/content/shell/shell_net_log.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2013 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/shell_net_log.h"
-
-#include <stdio.h>
-
-#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/values.h"
-#include "content/public/common/content_switches.h"
-#include "net/base/net_log_logger.h"
-
-namespace content {
-
-namespace {
-
-base::DictionaryValue* GetShellConstants() {
- base::DictionaryValue* constants_dict = net::NetLogLogger::GetConstants();
-
- // Add a dictionary with client information
- base::DictionaryValue* dict = new DictionaryValue();
-
- dict->SetString("name", "content_shell");
- dict->SetString("command_line",
- CommandLine::ForCurrentProcess()->GetCommandLineString());
-
- constants_dict->Set("clientInfo", dict);
-
- return constants_dict;
-}
-
-} // namespace
-
-ShellNetLog::ShellNetLog() {
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
-
- if (command_line->HasSwitch(switches::kLogNetLog)) {
- base::FilePath log_path =
- command_line->GetSwitchValuePath(switches::kLogNetLog);
- // Much like logging.h, bypass threading restrictions by using fopen
- // directly. Have to write on a thread that's shutdown to handle events on
- // shutdown properly, and posting events to another thread as they occur
- // would result in an unbounded buffer size, so not much can be gained by
- // doing this on another thread. It's only used when debugging, so
- // performance is not a big concern.
- FILE* file = NULL;
-#if defined(OS_WIN)
- file = _wfopen(log_path.value().c_str(), L"w");
-#elif defined(OS_POSIX)
- file = fopen(log_path.value().c_str(), "w");
-#endif
-
- if (file == NULL) {
- LOG(ERROR) << "Could not open file " << log_path.value()
- << " for net logging";
- } else {
- scoped_ptr<base::Value> constants(GetShellConstants());
- net_log_logger_.reset(new net::NetLogLogger(file, *constants));
- net_log_logger_->StartObserving(this);
- }
- }
-}
-
-ShellNetLog::~ShellNetLog() {
- // Remove the observer we own before we're destroyed.
- if (net_log_logger_)
- RemoveThreadSafeObserver(net_log_logger_.get());
-}
-
-} // namespace content
« no previous file with comments | « content/shell/shell_net_log.h ('k') | content/shell/shell_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698