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

Unified Diff: chrome/browser/net/chrome_net_log_helper.cc

Issue 1347043002: Move ChromeNetLog to //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DetachFromThread Created 5 years, 3 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
Index: chrome/browser/net/chrome_net_log_helper.cc
diff --git a/chrome/common/secure_origin_whitelist.cc b/chrome/browser/net/chrome_net_log_helper.cc
similarity index 30%
copy from chrome/common/secure_origin_whitelist.cc
copy to chrome/browser/net/chrome_net_log_helper.cc
index 3715b3b488d1a622f4df6e5b9b3ca58631bf9b63..6349dda3949ace7e1885add54c5dd309f8fbab98 100644
--- a/chrome/common/secure_origin_whitelist.cc
+++ b/chrome/browser/net/chrome_net_log_helper.cc
@@ -2,26 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/secure_origin_whitelist.h"
-
-#include <vector>
+#include "chrome/browser/net/chrome_net_log_helper.h"
#include "base/command_line.h"
-#include "base/strings/string_split.h"
+#include "base/logging.h"
#include "chrome/common/chrome_switches.h"
-void GetSecureOriginWhitelist(std::set<GURL>* origins) {
- // If kUnsafelyTreatInsecureOriginAsSecure option is given and
- // kUserDataDir is present, add the given origins as trustworthy
- // for whitelisting.
+net::NetLogCaptureMode GetNetCaptureMode() {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
eroman 2015/09/16 20:52:21 Can you make this an input parameter to the functi
droger 2015/09/17 08:39:10 Done.
- if (command_line.HasSwitch(switches::kUnsafelyTreatInsecureOriginAsSecure) &&
- command_line.HasSwitch(switches::kUserDataDir)) {
- std::string origins_str = command_line.GetSwitchValueASCII(
- switches::kUnsafelyTreatInsecureOriginAsSecure);
- for (const std::string& origin : base::SplitString(
- origins_str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))
- origins->insert(GURL(origin));
+
+ if (command_line.HasSwitch(switches::kNetLogCaptureMode)) {
+ std::string capture_mode_string =
+ command_line.GetSwitchValueASCII(switches::kNetLogCaptureMode);
+ if (capture_mode_string == "Default")
+ return net::NetLogCaptureMode::Default();
+ if (capture_mode_string == "IncludeCookiesAndCredentials")
+ return net::NetLogCaptureMode::IncludeCookiesAndCredentials();
+ if (capture_mode_string == "IncludeSocketBytes")
+ return net::NetLogCaptureMode::IncludeSocketBytes();
+
+ LOG(ERROR) << "Unrecognized value for --" << switches::kNetLogCaptureMode;
}
+
+ return net::NetLogCaptureMode::Default();
}

Powered by Google App Engine
This is Rietveld 408576698