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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h

Issue 2729613008: [instrumentation] Introduce InspectorTraceEvents agent (Closed)
Patch Set: . 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/InspectorTraceEvents.h
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
index b0d6478573f8b86428390ad27cfdee42a3f3f38c..6a09dd9f0d1cd4ca7f9643ac5efdb58acd1fe0d8 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
@@ -5,14 +5,16 @@
#ifndef InspectorTraceEvents_h
#define InspectorTraceEvents_h
+#include <memory>
+
#include "core/CoreExport.h"
#include "core/css/CSSSelector.h"
+#include "core/inspector/InspectorBaseAgent.h"
#include "platform/heap/Handle.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/instrumentation/tracing/TracedValue.h"
#include "wtf/Forward.h"
#include "wtf/Functional.h"
-#include <memory>
namespace v8 {
class Function;
@@ -29,9 +31,11 @@ class Animation;
class CSSStyleSheetResource;
class ContainerNode;
class Document;
+class DocumentLoader;
class Element;
class Event;
class ExecutionContext;
+struct FetchInitiatorInfo;
class FrameView;
class GraphicsLayer;
class HitTestLocation;
@@ -39,13 +43,15 @@ class HitTestRequest;
class HitTestResult;
class ImageResourceContent;
class InvalidationSet;
-class PaintLayer;
+class LayoutImage;
+class LayoutObject;
class LayoutRect;
class LocalFrame;
class Node;
+class PaintLayer;
class QualifiedName;
-class LayoutImage;
-class LayoutObject;
+class Resource;
+class ResourceError;
class ResourceRequest;
class ResourceResponse;
class StyleChangeReasonForTracing;
@@ -55,6 +61,53 @@ class XMLHttpRequest;
enum ResourceLoadPriority : int;
+class CORE_EXPORT InspectorTraceEvents : public InspectorAgent {
+ WTF_MAKE_NONCOPYABLE(InspectorTraceEvents);
+
+ public:
+ InspectorTraceEvents() {}
+
+ void init(InstrumentingAgents* instrumentingAgents,
pfeldman 2017/03/06 23:31:24 Let's put those into .cpp
alph 2017/03/07 00:57:48 Done.
+ protocol::UberDispatcher*,
+ protocol::DictionaryValue*) override {
+ m_instrumentingAgents = instrumentingAgents;
+ m_instrumentingAgents->addInspectorTraceEvents(this);
+ }
+ void dispose() override {
+ m_instrumentingAgents->removeInspectorTraceEvents(this);
+ m_instrumentingAgents = nullptr;
+ }
+
+ void willSendRequest(LocalFrame*,
+ unsigned long identifier,
+ DocumentLoader*,
+ ResourceRequest&,
+ const ResourceResponse& redirectResponse,
+ const FetchInitiatorInfo&);
+ void didReceiveResourceResponse(LocalFrame*,
+ unsigned long identifier,
+ DocumentLoader*,
+ const ResourceResponse&,
+ Resource*);
+ void didReceiveData(LocalFrame*,
+ unsigned long identifier,
+ const char* data,
+ int dataLength);
+ void didFinishLoading(unsigned long identifier,
+ double monotonicFinishTime,
+ int64_t encodedDataLength,
+ int64_t decodedBodyLength);
+ void didFailLoading(unsigned long identifier, const ResourceError&);
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {
+ visitor->trace(m_instrumentingAgents);
+ InspectorAgent::trace(visitor);
+ }
+
+ private:
+ Member<InstrumentingAgents> m_instrumentingAgents;
+};
+
namespace InspectorLayoutEvent {
std::unique_ptr<TracedValue> beginData(FrameView*);
std::unique_ptr<TracedValue> endData(LayoutObject* rootForThisLayout);

Powered by Google App Engine
This is Rietveld 408576698