OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "core/inspector/InspectorPageAgent.h" | 42 #include "core/inspector/InspectorPageAgent.h" |
43 #include "core/inspector/InspectorState.h" | 43 #include "core/inspector/InspectorState.h" |
44 #include "core/inspector/InstrumentingAgents.h" | 44 #include "core/inspector/InstrumentingAgents.h" |
45 #include "core/inspector/TimelineRecordFactory.h" | 45 #include "core/inspector/TimelineRecordFactory.h" |
46 #include "core/inspector/TimelineTraceEventProcessor.h" | 46 #include "core/inspector/TimelineTraceEventProcessor.h" |
47 #include "core/loader/DocumentLoader.h" | 47 #include "core/loader/DocumentLoader.h" |
48 #include "core/page/DOMWindow.h" | 48 #include "core/page/DOMWindow.h" |
49 #include "core/page/Frame.h" | 49 #include "core/page/Frame.h" |
50 #include "core/page/FrameView.h" | 50 #include "core/page/FrameView.h" |
51 #include "core/platform/MemoryUsageSupport.h" | 51 #include "core/platform/MemoryUsageSupport.h" |
| 52 #include "core/platform/chromium/TraceEvent.h" |
52 #include "core/platform/graphics/IntRect.h" | 53 #include "core/platform/graphics/IntRect.h" |
53 #include "core/platform/network/ResourceRequest.h" | 54 #include "core/platform/network/ResourceRequest.h" |
54 #include "core/platform/network/ResourceResponse.h" | 55 #include "core/platform/network/ResourceResponse.h" |
55 #include "core/rendering/RenderObject.h" | 56 #include "core/rendering/RenderObject.h" |
56 #include "core/rendering/RenderView.h" | 57 #include "core/rendering/RenderView.h" |
57 #include "core/xml/XMLHttpRequest.h" | 58 #include "core/xml/XMLHttpRequest.h" |
58 | 59 |
59 #include <wtf/CurrentTime.h> | 60 #include <wtf/CurrentTime.h> |
60 | 61 |
61 namespace WebCore { | 62 namespace WebCore { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 TimelineRecordFactory::appendStyleRecalcDetails(entry.data.get(), m_styleRec
alcElementCounter); | 353 TimelineRecordFactory::appendStyleRecalcDetails(entry.data.get(), m_styleRec
alcElementCounter); |
353 m_styleRecalcElementCounter = 0; | 354 m_styleRecalcElementCounter = 0; |
354 didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles); | 355 didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles); |
355 } | 356 } |
356 | 357 |
357 void InspectorTimelineAgent::didRecalculateStyleForElement() | 358 void InspectorTimelineAgent::didRecalculateStyleForElement() |
358 { | 359 { |
359 ++m_styleRecalcElementCounter; | 360 ++m_styleRecalcElementCounter; |
360 } | 361 } |
361 | 362 |
362 void InspectorTimelineAgent::willPaint(Frame* frame) | 363 void InspectorTimelineAgent::willPaint(RenderObject* renderer) |
363 { | 364 { |
| 365 Frame* frame = renderer->frame(); |
| 366 TRACE_EVENT_INSTANT2("instrumentation", InstrumentationEvents::Paint, |
| 367 InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long lo
ng>(frame->page()), |
| 368 InstrumentationEventArguments::NodeId, idForNode(renderer->generatingNod
e())); |
| 369 |
364 pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true
, frame, true); | 370 pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true
, frame, true); |
365 } | 371 } |
366 | 372 |
367 void InspectorTimelineAgent::didPaint(RenderObject* renderer, GraphicsContext*,
const LayoutRect& clipRect) | 373 void InspectorTimelineAgent::didPaint(RenderObject* renderer, GraphicsContext*,
const LayoutRect& clipRect) |
368 { | 374 { |
369 TimelineRecordEntry& entry = m_recordStack.last(); | 375 TimelineRecordEntry& entry = m_recordStack.last(); |
370 ASSERT(entry.type == TimelineRecordType::Paint); | 376 ASSERT(entry.type == TimelineRecordType::Paint); |
371 FloatQuad quad; | 377 FloatQuad quad; |
372 localToPageQuad(*renderer, clipRect, &quad); | 378 localToPageQuad(*renderer, clipRect, &quad); |
373 entry.data = TimelineRecordFactory::createPaintData(quad, idForNode(renderer
->generatingNode())); | 379 entry.data = TimelineRecordFactory::createPaintData(quad, idForNode(renderer
->generatingNode())); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 { | 792 { |
787 Frame* frame = renderer.frame(); | 793 Frame* frame = renderer.frame(); |
788 FrameView* view = frame->view(); | 794 FrameView* view = frame->view(); |
789 FloatQuad absolute = renderer.localToAbsoluteQuad(FloatQuad(rect)); | 795 FloatQuad absolute = renderer.localToAbsoluteQuad(FloatQuad(rect)); |
790 quad->setP1(view->contentsToRootView(roundedIntPoint(absolute.p1()))); | 796 quad->setP1(view->contentsToRootView(roundedIntPoint(absolute.p1()))); |
791 quad->setP2(view->contentsToRootView(roundedIntPoint(absolute.p2()))); | 797 quad->setP2(view->contentsToRootView(roundedIntPoint(absolute.p2()))); |
792 quad->setP3(view->contentsToRootView(roundedIntPoint(absolute.p3()))); | 798 quad->setP3(view->contentsToRootView(roundedIntPoint(absolute.p3()))); |
793 quad->setP4(view->contentsToRootView(roundedIntPoint(absolute.p4()))); | 799 quad->setP4(view->contentsToRootView(roundedIntPoint(absolute.p4()))); |
794 } | 800 } |
795 | 801 |
796 int InspectorTimelineAgent::idForNode(Node* node) | 802 long long InspectorTimelineAgent::idForNode(Node* node) |
797 { | 803 { |
798 return m_domAgent && node ? m_domAgent->backendNodeIdForNode(node, BackendNo
deIdGroup) : 0; | 804 return m_domAgent && node ? m_domAgent->backendNodeIdForNode(node, BackendNo
deIdGroup) : 0; |
799 } | 805 } |
800 | 806 |
801 void InspectorTimelineAgent::releaseNodeIds() | 807 void InspectorTimelineAgent::releaseNodeIds() |
802 { | 808 { |
803 ErrorString unused; | 809 ErrorString unused; |
804 if (m_domAgent) | 810 if (m_domAgent) |
805 m_domAgent->releaseBackendNodeIds(&unused, BackendNodeIdGroup); | 811 m_domAgent->releaseBackendNodeIds(&unused, BackendNodeIdGroup); |
806 } | 812 } |
807 | 813 |
808 double InspectorTimelineAgent::timestamp() | 814 double InspectorTimelineAgent::timestamp() |
809 { | 815 { |
810 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc
reasingTime()); | 816 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc
reasingTime()); |
811 } | 817 } |
812 | 818 |
813 Page* InspectorTimelineAgent::page() | 819 Page* InspectorTimelineAgent::page() |
814 { | 820 { |
815 return m_pageAgent ? m_pageAgent->page() : 0; | 821 return m_pageAgent ? m_pageAgent->page() : 0; |
816 } | 822 } |
817 | 823 |
818 } // namespace WebCore | 824 } // namespace WebCore |
819 | 825 |
OLD | NEW |