Commit 52cc2b7b authored by estark@chromium.org's avatar estark@chromium.org

DevTools: add a mixed-content filter

BUG=504537
TEST=Open Network Panel, navigate to mixed.badssl.com, type
"mixed-content:true" in the filter

Review URL: https://codereview.chromium.org/1320343005

git-svn-id: svn://svn.chromium.org/blink/trunk@201669 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b257947a
......@@ -132,6 +132,7 @@ WebInspector.NetworkLogView.FilterType = {
LargerThan: "larger-than",
Method: "method",
MimeType: "mime-type",
MixedContent: "mixed-content",
Scheme: "scheme",
SetCookieDomain: "set-cookie-domain",
SetCookieName: "set-cookie-name",
......@@ -1084,6 +1085,19 @@ WebInspector.NetworkLogView.prototype = {
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.Scheme, "" + request.scheme);
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.StatusCode, "" + request.statusCode);
if (request.mixedContentType !== "none") {
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.MixedContent, "all");
}
if (request.mixedContentType === "optionally-blockable") {
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.MixedContent, "displayed");
}
if (request.mixedContentType === "blockable") {
var suggestion = request.blocked ? "blocked" : "block-overridden";
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.MixedContent, suggestion);
}
var responseHeaders = request.responseHeaders;
for (var i = 0, l = responseHeaders.length; i < l; ++i)
this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.HasResponseHeader, responseHeaders[i].name);
......@@ -1681,6 +1695,9 @@ WebInspector.NetworkLogView.prototype = {
case WebInspector.NetworkLogView.FilterType.MimeType:
return WebInspector.NetworkLogView._requestMimeTypeFilter.bind(null, value);
case WebInspector.NetworkLogView.FilterType.MixedContent:
return WebInspector.NetworkLogView._requestMixedContentFilter.bind(null, value);
case WebInspector.NetworkLogView.FilterType.Scheme:
return WebInspector.NetworkLogView._requestSchemeFilter.bind(null, value);
......@@ -1995,6 +2012,25 @@ WebInspector.NetworkLogView._requestMimeTypeFilter = function(value, request)
return request.mimeType === value;
}
/**
* @param {string} value
* @param {!WebInspector.NetworkRequest} request
* @return {boolean}
*/
WebInspector.NetworkLogView._requestMixedContentFilter = function(value, request)
{
if (value === "displayed") {
return request.mixedContentType === "optionally-blockable";
} else if (value === "blocked") {
return request.mixedContentType === "blockable" && request.blocked;
} else if (value === "block-overridden") {
return request.mixedContentType === "blockable" && !request.blocked;
} else if (value === "all") {
return request.mixedContentType !== "none";
}
return false;
}
/**
* @param {string} value
* @param {!WebInspector.NetworkRequest} request
......
......@@ -195,6 +195,7 @@ WebInspector.NetworkDispatcher.prototype = {
networkRequest.setRequestHeaders(this._headersMapToHeadersArray(request.headers));
networkRequest.requestFormData = request.postData;
networkRequest.setInitialPriority(request.initialPriority);
networkRequest.mixedContentType = request.mixedContentType;
},
/**
......
......@@ -60,6 +60,7 @@ WebInspector.NetworkRequest = function(target, requestId, url, documentURL, fram
this.requestMethod = "";
this.requestTime = 0;
this.protocol = "";
this.mixedContentType = "";
/** @type {?NetworkAgent.ResourcePriority} */
this._initialPriority = null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment