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

Side by Side Diff: Source/core/inspector/InspectorTraceEvents.cpp

Issue 465223002: [ Do not submit ] Prototype for invalidation analysis Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix multiple paint bug, fix bug where nodes did not linkify properly, minor cleanups Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/inspector/InspectorTraceEvents.h" 6 #include "core/inspector/InspectorTraceEvents.h"
7 7
8 #include "bindings/core/v8/ScriptCallStackFactory.h" 8 #include "bindings/core/v8/ScriptCallStackFactory.h"
9 #include "bindings/core/v8/ScriptGCEvent.h" 9 #include "bindings/core/v8/ScriptGCEvent.h"
10 #include "bindings/core/v8/ScriptSourceCode.h" 10 #include "bindings/core/v8/ScriptSourceCode.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 RefPtr<TracedValue> value = TracedValue::create(); 102 RefPtr<TracedValue> value = TracedValue::create();
103 if (quads.size() >= 1) { 103 if (quads.size() >= 1) {
104 createQuad(value.get(), "root", quads[0]); 104 createQuad(value.get(), "root", quads[0]);
105 setGeneratingNodeId(value.get(), "rootNode", rootForThisLayout); 105 setGeneratingNodeId(value.get(), "rootNode", rootForThisLayout);
106 } else { 106 } else {
107 ASSERT_NOT_REACHED(); 107 ASSERT_NOT_REACHED();
108 } 108 }
109 return value; 109 return value;
110 } 110 }
111 111
112 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidationTrack ingEvent::data(Node* node)
113 {
114 ASSERT(node);
115 RefPtr<TracedValue> value = TracedValue::create();
116 value->setString("frame", toHexString(node->document().frame()));
117 value->setString("nodeName", node->debugName());
118 value->setInteger("nodeId", InspectorNodeIds::idForNode(node));
119 RefPtr<ScriptCallStack> callstack = createScriptCallStack(5, true);
120 value->setString("callstack", callstack ? callstack->buildInspectorArray()-> toJSONString() : "[]");
121 return value;
122 }
123
124 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutInvalidationTrac kingEvent::data(RenderObject* renderer)
125 {
126 ASSERT(renderer);
127 RefPtr<TracedValue> value = TracedValue::create();
128 value->setString("frame", toHexString(renderer->frame()));
129 setGeneratingNodeId(value.get(), "nodeId", renderer);
caseq 2014/08/26 12:19:07 can we just use the node id of the generating node
130 RefPtr<ScriptCallStack> callstack = createScriptCallStack(5, true);
131 value->setString("callstack", callstack ? callstack->buildInspectorArray()-> toJSONString() : "[]");
caseq 2014/08/26 12:19:07 we normally expose callstacks via a separate event
132 return value;
133 }
134
135 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorPaintInvalidationTrack ingEvent::data(RenderObject* renderer)
136 {
137 ASSERT(renderer);
138 RefPtr<TracedValue> value = TracedValue::create();
139
140 value->setString("frame", toHexString(renderer->frame()));
141 setGeneratingNodeId(value.get(), "nodeId", renderer);
caseq 2014/08/26 12:19:07 ditto.
142 return value;
143 }
144
112 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorSendRequestEvent::data (unsigned long identifier, LocalFrame* frame, const ResourceRequest& request) 145 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorSendRequestEvent::data (unsigned long identifier, LocalFrame* frame, const ResourceRequest& request)
113 { 146 {
114 String requestId = IdentifiersFactory::requestId(identifier); 147 String requestId = IdentifiersFactory::requestId(identifier);
115 148
116 RefPtr<TracedValue> value = TracedValue::create(); 149 RefPtr<TracedValue> value = TracedValue::create();
117 value->setString("requestId", requestId); 150 value->setString("requestId", requestId);
118 value->setString("frame", toHexString(frame)); 151 value->setString("frame", toHexString(frame));
119 value->setString("url", request.url().string()); 152 value->setString("url", request.url().string());
120 value->setString("requestMethod", request.httpMethod()); 153 value->setString("requestMethod", request.httpMethod());
121 return value; 154 return value;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTimeStampEvent::data(E xecutionContext* context, const String& message) 382 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTimeStampEvent::data(E xecutionContext* context, const String& message)
350 { 383 {
351 RefPtr<TracedValue> value = TracedValue::create(); 384 RefPtr<TracedValue> value = TracedValue::create();
352 value->setString("message", message); 385 value->setString("message", message);
353 if (LocalFrame* frame = frameForExecutionContext(context)) 386 if (LocalFrame* frame = frameForExecutionContext(context))
354 value->setString("frame", toHexString(frame)); 387 value->setString("frame", toHexString(frame));
355 return value; 388 return value;
356 } 389 }
357 390
358 } 391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698