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

Unified Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 1299493003: Attach mixed content status to resource requests when sent to devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add contextTypeForInspector() unit test 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
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorResourceAgent.cpp
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index 1abfe5b54ab4cc72f619e7984b4a85ad11c79634..c15570da9dd94e595674fab1f83bf71d54ee4b47 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -58,6 +58,7 @@
#include "core/inspector/ScriptCallStack.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
+#include "core/loader/MixedContentChecker.h"
#include "core/loader/ThreadableLoaderClient.h"
#include "core/page/Page.h"
#include "core/xmlhttprequest/XMLHttpRequest.h"
@@ -176,6 +177,21 @@ KURL urlWithoutFragment(const KURL& url)
return result;
}
+TypeBuilder::Network::Request::MixedContentType::Enum mixedContentTypeForContextType(MixedContentChecker::ContextType contextType)
+{
+ switch (contextType) {
+ case MixedContentChecker::ContextTypeNotMixedContent:
+ return TypeBuilder::Network::Request::MixedContentType::None;
+ case MixedContentChecker::ContextTypeBlockable:
+ return TypeBuilder::Network::Request::MixedContentType::Blockable;
+ case MixedContentChecker::ContextTypeOptionallyBlockable:
+ case MixedContentChecker::ContextTypeShouldBeBlockable:
+ return TypeBuilder::Network::Request::MixedContentType::Optionally_blockable;
+ }
+
+ return TypeBuilder::Network::Request::MixedContentType::None;
+}
+
} // namespace
void InspectorResourceAgent::restore()
@@ -349,7 +365,7 @@ DEFINE_TRACE(InspectorResourceAgent)
InspectorBaseAgent::trace(visitor);
}
-void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& initiatorInfo)
+void InspectorResourceAgent::willSendRequest(LocalFrame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& initiatorInfo)
{
// Ignore the request initiated internally.
if (initiatorInfo.name == FetchInitiatorTypeNames::internal)
@@ -398,6 +414,8 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
RefPtr<TypeBuilder::Network::Request> requestInfo(buildObjectForResourceRequest(request));
+ requestInfo->setMixedContentType(mixedContentTypeForContextType(MixedContentChecker::contextTypeForInspector(frame, request)));
+
if (!m_hostId.isEmpty())
request.addHTTPHeaderField(kDevToolsEmulateNetworkConditionsClientId, AtomicString(m_hostId));
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/loader/FrameFetchContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698