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

Unified Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 8997012: Make incognito windows not inherit HSTS state from the main profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: g try Created 8 years, 12 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/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index b6eb8eb35ef3f8ab7776330871b0415913fbbf6d..18735a8124b9ec5829652f5774586f8dd9e70139 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/profiles/off_the_record_profile_io_data.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "build/build_config.h"
@@ -14,6 +15,7 @@
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -154,8 +156,13 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
ApplyProfileParamsToContext(main_context);
ApplyProfileParamsToContext(extensions_context);
- main_context->set_transport_security_state(transport_security_state());
- extensions_context->set_transport_security_state(transport_security_state());
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ transport_security_state_.reset(new net::TransportSecurityState(
+ command_line.GetSwitchValueASCII(switches::kHstsHosts)));
+
+ main_context->set_transport_security_state(transport_security_state_.get());
wtc 2012/01/06 18:45:52 One reason I am confused is this code: it seems to
agl 2012/01/06 19:08:47 I don't believe so. There's a main_context (a.k.a.
+ extensions_context->set_transport_security_state(
+ transport_security_state_.get());
main_context->set_net_log(io_thread->net_log());
extensions_context->set_net_log(io_thread->net_log());
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl_io_data.h » ('j') | chrome/browser/profiles/profile_io_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698