Commit e1e958cb authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Cleanup some core probes

Bug: none
Change-Id: I1342bd4f416a8e1f21d521efd6c05d535a3442c8
Reviewed-on: https://chromium-review.googlesource.com/1076684Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562524}
parent a7ed9ba5
......@@ -1107,28 +1107,7 @@ void InspectorNetworkAgent::WillLoadXHR(XMLHttpRequest* xhr,
pending_xhr_replay_data_->AddHeader(header.key, header.value);
}
void InspectorNetworkAgent::DidFailXHRLoading(ExecutionContext* context,
XMLHttpRequest* xhr,
ThreadableLoaderClient* client,
const AtomicString& method,
const String& url) {
DidFinishXHRInternal(context, xhr, client, method, url, false);
}
void InspectorNetworkAgent::DidFinishXHRLoading(ExecutionContext* context,
XMLHttpRequest* xhr,
ThreadableLoaderClient* client,
const AtomicString& method,
const String& url) {
DidFinishXHRInternal(context, xhr, client, method, url, true);
}
void InspectorNetworkAgent::DidFinishXHRInternal(ExecutionContext* context,
XMLHttpRequest* xhr,
ThreadableLoaderClient* client,
const AtomicString& method,
const String& url,
bool success) {
void InspectorNetworkAgent::DidFinishXHR(XMLHttpRequest* xhr) {
// This method will be called from the XHR.
// We delay deleting the replay XHR, as deleting here may delete the caller.
if (!replay_xhrs_.Contains(xhr))
......
......@@ -132,16 +132,7 @@ class CORE_EXPORT InspectorNetworkAgent final
bool async,
const HTTPHeaderMap& headers,
bool include_crendentials);
void DidFailXHRLoading(ExecutionContext*,
XMLHttpRequest*,
ThreadableLoaderClient*,
const AtomicString&,
const String&);
void DidFinishXHRLoading(ExecutionContext*,
XMLHttpRequest*,
ThreadableLoaderClient*,
const AtomicString&,
const String&);
void DidFinishXHR(XMLHttpRequest*);
void WillStartFetch(ThreadableLoaderClient*);
......
......@@ -405,9 +405,9 @@ void DocumentLoader::NotifyFinished(Resource* resource) {
application_cache_host_->FailedLoadingMainResource();
if (resource->GetResourceError().WasBlockedByResponse()) {
probe::CanceledAfterReceivedResourceResponse(
frame_, this, MainResourceIdentifier(), resource->GetResponse(),
resource);
probe::didReceiveResourceResponse(frame_->GetDocument(),
MainResourceIdentifier(), this,
resource->GetResponse(), resource);
}
LoadFailed(resource->GetResourceError());
......@@ -562,8 +562,9 @@ bool DocumentLoader::ShouldContinueForResponse() const {
void DocumentLoader::CancelLoadAfterCSPDenied(
const ResourceResponse& response) {
probe::CanceledAfterReceivedResourceResponse(
frame_, this, MainResourceIdentifier(), response, GetResource());
probe::didReceiveResourceResponse(frame_->GetDocument(),
MainResourceIdentifier(), this, response,
GetResource());
SetWasBlockedAfterCSP();
......@@ -657,8 +658,9 @@ void DocumentLoader::ResponseReceived(
resource->SetDataBufferingPolicy(kBufferData);
if (!ShouldContinueForResponse()) {
probe::ContinueWithPolicyIgnore(frame_, this, resource->Identifier(),
response_, resource);
probe::didReceiveResourceResponse(frame_->GetDocument(),
resource->Identifier(), this, response_,
resource);
fetcher_->StopFetching();
return;
}
......
......@@ -5,6 +5,10 @@
include_path: "third_party/blink/renderer/core/inspector",
includes: [
"third_party/blink/renderer/core/CoreProbeSink.h",
"third_party/blink/renderer/core/animation/animation.h",
"third_party/blink/renderer/core/dom/pseudo_element.h",
"third_party/blink/renderer/core/html/html_slot_element.h",
"third_party/blink/renderer/core/page/chrome_client.h",
"third_party/blink/renderer/core/probe/core_probes.h",
],
},
......@@ -112,9 +116,8 @@
"didCommitLoad",
"didCreateWebSocket",
"didFailLoading",
"didFailXHRLoading",
"didFinishLoading",
"didFinishXHRLoading",
"didFinishXHR",
"didReceiveCORSRedirectResponse",
"didReceiveData",
"didReceiveBlob",
......
......@@ -105,8 +105,7 @@ interface CoreProbes {
void willSendEventSourceRequest(ExecutionContext*, ThreadableLoaderClient* eventSource);
void willDispatchEventSourceEvent(ExecutionContext*, unsigned long identifier, const AtomicString& eventName, const AtomicString& eventId, const String& data);
void willLoadXHR(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const KURL& url, bool async, const HTTPHeaderMap& headers, bool includeCredentials);
void didFailXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
void didFinishXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
void didFinishXHR(ExecutionContext*, XMLHttpRequest* xhr);
void willStartFetch(ExecutionContext*, ThreadableLoaderClient*);
void scriptImported(ExecutionContext*, unsigned long identifier, const String& sourceString);
void scriptExecutionBlockedByCSP(ExecutionContext*, const String& directiveText);
......
......@@ -31,21 +31,9 @@
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/CoreProbeSink.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
#include "third_party/blink/renderer/core/inspector/inspector_css_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_dom_debugger_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_network_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_page_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_session.h"
#include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
#include "third_party/blink/renderer/core/inspector/main_thread_debugger.h"
#include "third_party/blink/renderer/core/inspector/thread_debugger.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_initiator_info.h"
namespace blink {
namespace probe {
......@@ -126,30 +114,5 @@ void AllAsyncTasksCanceled(ExecutionContext* context) {
debugger->AllAsyncTasksCanceled();
}
void DidReceiveResourceResponseButCanceled(LocalFrame* frame,
DocumentLoader* loader,
unsigned long identifier,
const ResourceResponse& r,
Resource* resource) {
didReceiveResourceResponse(frame->GetDocument(), identifier, loader, r,
resource);
}
void CanceledAfterReceivedResourceResponse(LocalFrame* frame,
DocumentLoader* loader,
unsigned long identifier,
const ResourceResponse& r,
Resource* resource) {
DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource);
}
void ContinueWithPolicyIgnore(LocalFrame* frame,
DocumentLoader* loader,
unsigned long identifier,
const ResourceResponse& r,
Resource* resource) {
DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource);
}
} // namespace probe
} // namespace blink
......@@ -31,19 +31,14 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PROBE_CORE_PROBES_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_PROBE_CORE_PROBES_H_
#include "third_party/blink/renderer/core/animation/animation.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/platform/probe/platform_probes.h"
namespace blink {
class CoreProbeSink;
class Resource;
class ThreadDebugger;
namespace probe {
......@@ -101,18 +96,7 @@ CORE_EXPORT void AsyncTaskCanceled(v8::Isolate*, void*);
CORE_EXPORT void AsyncTaskCanceledBreakable(ExecutionContext*,
const char* name,
void*);
CORE_EXPORT void AllAsyncTasksCanceled(ExecutionContext*);
CORE_EXPORT void CanceledAfterReceivedResourceResponse(LocalFrame*,
DocumentLoader*,
unsigned long identifier,
const ResourceResponse&,
Resource*);
CORE_EXPORT void ContinueWithPolicyIgnore(LocalFrame*,
DocumentLoader*,
unsigned long identifier,
const ResourceResponse&,
Resource*);
} // namespace probe
} // namespace blink
......
......@@ -1330,7 +1330,7 @@ void XMLHttpRequest::HandleRequestError(ExceptionCode exception_code,
long long expected_length) {
NETWORK_DVLOG(1) << this << " handleRequestError()";
probe::didFailXHRLoading(GetExecutionContext(), this, this, method_, url_);
probe::didFinishXHR(GetExecutionContext(), this);
send_flag_ = false;
if (!async_) {
......@@ -1705,7 +1705,7 @@ void XMLHttpRequest::NotifyParserStopped() {
}
void XMLHttpRequest::EndLoading() {
probe::didFinishXHRLoading(GetExecutionContext(), this, this, method_, url_);
probe::didFinishXHR(GetExecutionContext(), this);
if (loader_) {
// Set |m_error| in order to suppress the cancel notification (see
......
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