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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp

Issue 2739323003: DevTools protocol interception, blocking & modification of requests (Closed)
Patch Set: Add missing expects plus tweak test output of Network.interceptedRedirect for clarity Created 3 years, 9 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: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
index 7d076919f2662f55d71cf10b0ac3ea42697ece4c..c514823ea13efdb07e8e7ed7f71c7ddf67000cd2 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -757,11 +757,19 @@ void InspectorNetworkAgent::didReceiveResourceResponse(
responseSecurityDetails->certificate);
}
- if (resourceResponse && !resourceIsEmpty)
+ String interceptId =
+ response.httpHeaderField(HTTPNames::X_DevTools_Intercept_Id);
+ if (!interceptId.isEmpty()) {
+ const_cast<ResourceResponse&>(response).clearHTTPHeaderField(
+ HTTPNames::X_DevTools_Intercept_Id);
+ }
+
+ if (resourceResponse && !resourceIsEmpty) {
frontend()->responseReceived(requestId, frameId, loaderId,
monotonicallyIncreasingTime(),
InspectorPageAgent::resourceTypeJson(type),
- std::move(resourceResponse));
+ std::move(resourceResponse), interceptId);
+ }
// If we revalidated the resource and got Not modified, send content length
// following didReceiveResponse as there will be no calls to didReceiveData
// from the network stack.

Powered by Google App Engine
This is Rietveld 408576698