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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 1211933005: Initial (partial) implementation of HPKP violation reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style fixes, comments Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 820
821 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000); 821 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000);
822 net::HashValueVector hashes; 822 net::HashValueVector hashes;
823 if (!hashes_str.empty()) { 823 if (!hashes_str.empty()) {
824 if (!Base64StringToHashes(hashes_str, &hashes)) 824 if (!Base64StringToHashes(hashes_str, &hashes))
825 return; 825 return;
826 } 826 }
827 827
828 transport_security_state->AddHSTS(domain, expiry, sts_include_subdomains); 828 transport_security_state->AddHSTS(domain, expiry, sts_include_subdomains);
829 transport_security_state->AddHPKP(domain, expiry, pkp_include_subdomains, 829 transport_security_state->AddHPKP(domain, expiry, pkp_include_subdomains,
830 hashes); 830 hashes, std::string());
831 } 831 }
832 832
833 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSDelete( 833 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSDelete(
834 const base::ListValue* list) { 834 const base::ListValue* list) {
835 // |list| should be: [<domain to query>]. 835 // |list| should be: [<domain to query>].
836 std::string domain; 836 std::string domain;
837 CHECK(list->GetString(0, &domain)); 837 CHECK(list->GetString(0, &domain));
838 if (!base::IsStringASCII(domain)) { 838 if (!base::IsStringASCII(domain)) {
839 // There cannot be a unicode entry in the HSTS set. 839 // There cannot be a unicode entry in the HSTS set.
840 return; 840 return;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 } 1190 }
1191 1191
1192 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1192 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1193 : WebUIController(web_ui) { 1193 : WebUIController(web_ui) {
1194 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1194 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1195 1195
1196 // Set up the chrome://net-internals/ source. 1196 // Set up the chrome://net-internals/ source.
1197 Profile* profile = Profile::FromWebUI(web_ui); 1197 Profile* profile = Profile::FromWebUI(web_ui);
1198 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1198 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1199 } 1199 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/chrome_fraudulent_certificate_reporter_unittest.cc ('k') | net/http/certificate_report_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698