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

Unified Diff: chrome/browser/resources/net_internals/hsts_view.js

Issue 12974003: Improve TransportSecurityState data storage. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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/resources/net_internals/hsts_view.js
===================================================================
--- chrome/browser/resources/net_internals/hsts_view.js (revision 186438)
+++ chrome/browser/resources/net_internals/hsts_view.js (working copy)
@@ -111,65 +111,24 @@
this.queryOutputDiv_.innerHTML = '';
var s = addNode(this.queryOutputDiv_, 'span');
- s.innerHTML = '<b>Found</b>: mode: ';
+ s.innerHTML = '<b>Found</b>: ';
- var t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = modeToString(result.mode);
+ var propertyNamesToDisplay = ['HSTS', 'Public_Key_Pins_Good',
+ 'Public_Key_Pins_Bad'];
- addTextNode(this.queryOutputDiv_, ' include_subdomains:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.subdomains;
-
- addTextNode(this.queryOutputDiv_, ' domain:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
- t.textContent = result.domain;
-
- addTextNode(this.queryOutputDiv_, ' pubkey_hashes:');
-
- t = addNode(this.queryOutputDiv_, 'tt');
-
- // |public_key_hashes| is an old synonym for what is now
- // |preloaded_spki_hashes|, which in turn is a legacy synonym for
- // |static_spki_hashes|. Look for all three, and also for
- // |dynamic_spki_hashes|.
- if (typeof result.public_key_hashes === 'undefined')
- result.public_key_hashes = '';
- if (typeof result.preloaded_spki_hashes === 'undefined')
- result.preloaded_spki_hashes = '';
- if (typeof result.static_spki_hashes === 'undefined')
- result.static_spki_hashes = '';
- if (typeof result.dynamic_spki_hashes === 'undefined')
- result.dynamic_spki_hashes = '';
-
- var hashes = [];
- if (result.public_key_hashes)
- hashes.push(result.public_key_hashes);
- if (result.preloaded_spki_hashes)
- hashes.push(result.preloaded_spki_hashes);
- if (result.static_spki_hashes)
- hashes.push(result.static_spki_hashes);
- if (result.dynamic_spki_hashes)
- hashes.push(result.dynamic_spki_hashes);
-
- t.textContent = hashes.join(',');
+ for (var i = 0; i < propertyNamesToDisplay.length; ++i) {
+ var propName = propertyNamesToDisplay[i];
+ var prop = result[propName];
+ if (prop != undefined) {
+ addTextNode(this.queryOutputDiv_, ' ' + propName + ':');
+ var t = addNode(this.queryOutputDiv_, 'tt');
+ t.textContent = prop;
+ }
+ }
yellowFade(this.queryOutputDiv_);
}
};
- function modeToString(m) {
- // These numbers must match those in
- // TransportSecurityState::DomainState::UpgradeMode.
- if (m == 0) {
- return 'STRICT';
- } else if (m == 1) {
- return 'OPPORTUNISTIC';
- } else {
- return 'UNKNOWN';
- }
- }
-
function yellowFade(element) {
element.style.webkitTransitionProperty = 'background-color';
element.style.webkitTransitionDuration = '0';
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698