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

Unified Diff: Source/devtools/front_end/sdk/NetworkManager.js

Issue 1284413004: Keep track of per-origin security details in the Security panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/devtools/front_end/sdk/NetworkManager.js
diff --git a/Source/devtools/front_end/sdk/NetworkManager.js b/Source/devtools/front_end/sdk/NetworkManager.js
index 96f65d817ea90cb785602cbfc224d3fcde8da50a..90ec4d1ec4239a921b78d60a51d3e9421d164a4a 100644
--- a/Source/devtools/front_end/sdk/NetworkManager.js
+++ b/Source/devtools/front_end/sdk/NetworkManager.js
@@ -54,7 +54,8 @@ WebInspector.NetworkManager.EventTypes = {
RequestStarted: "RequestStarted",
RequestUpdated: "RequestUpdated",
RequestFinished: "RequestFinished",
- RequestUpdateDropped: "RequestUpdateDropped"
+ RequestUpdateDropped: "RequestUpdateDropped",
+ ReceivedResponseSecurity: "ReceivedResponseSecurity"
}
WebInspector.NetworkManager._MIMETypes = {
@@ -349,6 +350,21 @@ WebInspector.NetworkDispatcher.prototype = {
this._updateNetworkRequestWithResponse(networkRequest, response);
this._updateNetworkRequest(networkRequest);
+
+ var securityEventData = {};
+ securityEventData.requestId = requestId;
+ // TODO(lgarron): This is ridiculously hacky, and should never land as-is. Calculate the proper origin.
dgozman 2015/08/18 18:41:49 Take a look at WebInspector.ParsedURL.
lgarron 2015/08/18 19:37:06 Thanks, that's what I need for now! (We discussed
+ securityEventData.origin = response.url.split("/").slice(0, 3).join("/");
+ securityEventData.securityState = response.securityState;
+ if (securityEventData.securityDetails) {
+ this._manager._networkAgent.getCertificateDetails(response.securityDetails.certificateId, (function(error, certificateDetails) {
pfeldman 2015/08/18 18:35:08 Please name the function and annotate it.
lgarron 2015/08/18 19:37:06 Is it alright if I do this inline, or should I add
lgarron 2015/08/18 21:40:58 Actually, it seems _initNetworkConditions has a gr
+ securityEventData.securityDetails = response.securityDetails;
+ securityEventData.certificateDetails = certificateDetails;
+ this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ReceivedResponseSecurity, securityEventData);
+ }).bind(this));
+ } else {
+ this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ReceivedResponseSecurity, securityEventData);
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698