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

Unified Diff: Source/modules/fetch/FetchManager.cpp

Issue 1259393002: DevTools: add support for logging fetch requests when XHR logging is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index e746bc53289498fa74207e17d4e5c6d82d427f3d..ad248f9fd716fd894f20242f24eeead2ec157611 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -17,6 +17,7 @@
#include "core/frame/Frame.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/ThreadableLoader.h"
#include "core/loader/ThreadableLoaderClient.h"
#include "core/page/ChromeClient.h"
@@ -156,7 +157,7 @@ void FetchManager::Loader::didFinishLoading(unsigned long, double)
&& m_responseHttpStatusCode >= 200 && m_responseHttpStatusCode < 300) {
document()->frame()->page()->chromeClient().ajaxSucceeded(document()->frame());
}
-
+ InspectorInstrumentation::didFinishFetch(executionContext(), this, m_request->method(), m_request->url().string());
notifyFinished();
}
@@ -381,9 +382,12 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla
threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl;
break;
}
+ InspectorInstrumentation::willStartFetch(executionContext(), this);
m_loader = ThreadableLoader::create(*executionContext(), this, request, threadableLoaderOptions, resourceLoaderOptions);
- if (!m_loader)
+ if (!m_loader) {
+ InspectorInstrumentation::didFailFetch(executionContext(), this);
performNetworkError("Can't create ThreadableLoader");
+ }
}
void FetchManager::Loader::failed(const String& message)
@@ -400,6 +404,7 @@ void FetchManager::Loader::failed(const String& message)
ScriptState::Scope scope(state);
m_resolver->reject(V8ThrowException::createTypeError(state->isolate(), "Failed to fetch"));
}
+ InspectorInstrumentation::didFailFetch(executionContext(), this);
notifyFinished();
}
« Source/core/inspector/InspectorResourceAgent.cpp ('K') | « Source/devtools/protocol.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698