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

Side by Side Diff: Source/core/timing/PerformanceDrawTiming.h

Issue 390193003: [not for review] Add Draw entries to window Performance Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code refactoring in RenderView Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 11 matching lines...) Expand all
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef PerformanceEntry_h 32 #ifndef PerformanceDrawTiming_h
33 #define PerformanceEntry_h 33 #define PerformanceDrawTiming_h
34 34
35 #include "bindings/core/v8/ScriptWrappable.h" 35 #include "core/timing/PerformanceEntry.h"
36 #include "platform/heap/Handle.h" 36 #include "platform/heap/Handle.h"
37 #include "wtf/PassRefPtr.h" 37 #include "wtf/PassRefPtr.h"
38 #include "wtf/RefCounted.h" 38 #include "wtf/RefPtr.h"
39 #include "wtf/text/WTFString.h"
40 39
41 namespace WebCore { 40 namespace WebCore {
42 41
43 class PerformanceEntry : public RefCountedWillBeGarbageCollectedFinalized<Perfor manceEntry>, public ScriptWrappable { 42 class Document;
43 class KURL;
44 class ResourceLoadTiming;
45 class ResourceRequest;
46 class ResourceResponse;
47 class ResourceTimingInfo;
48
49 class PerformanceDrawTiming FINAL : public PerformanceEntry {
44 public: 50 public:
45 virtual ~PerformanceEntry(); 51 static PassRefPtrWillBeRawPtr<PerformanceDrawTiming> create(Document* reques tingDocument, unsigned sourceFrame, double startTime, bool isFinal)
46
47 String name() const;
48 String entryType() const;
49 double startTime() const;
50 double duration() const;
51
52 virtual bool isResource() { return false; }
53 virtual bool isMark() { return false; }
54 virtual bool isMeasure() { return false; }
55
56 static bool startTimeCompareLessThan(PassRefPtrWillBeRawPtr<PerformanceEntry > a, PassRefPtrWillBeRawPtr<PerformanceEntry> b)
57 { 52 {
58 return a->startTime() < b->startTime(); 53 return adoptRefWillBeNoop(new PerformanceDrawTiming(requestingDocument, sourceFrame, startTime, isFinal));
59 } 54 }
60 55
61 virtual void trace(Visitor*) { } 56 static PassRefPtrWillBeRawPtr<PerformanceDrawTiming> create(Document* reques tingDocument, unsigned sourceFrame, double startTime)
57 {
58 return adoptRefWillBeNoop(new PerformanceDrawTiming(requestingDocument, sourceFrame, startTime, false));
59 }
62 60
63 protected: 61 unsigned sourceFrame() const;
64 PerformanceEntry(const String& name, const String& entryType, double startTi me, double finishTime); 62
63 bool isFinal() const;
64
65 virtual bool isDraw() OVERRIDE { return true; }
66
67 virtual void trace(Visitor* visitor)
68 {
69 PerformanceEntry::trace(visitor);
70 }
65 71
66 private: 72 private:
67 const String m_name; 73 PerformanceDrawTiming(Document* requestingDocument, unsigned sourceFrame, do uble startTime, bool isFinal);
68 const String m_entryType; 74 virtual ~PerformanceDrawTiming();
69 const double m_startTime; 75
70 const double m_duration; 76 unsigned m_sourceFrame;
77 bool m_isFinal;
78 RefPtr<Document> m_requestingDocument;
71 }; 79 };
72 80
73 } 81 }
74 82
75 #endif // !defined(PerformanceEntry_h) 83 #endif // !defined(PerformanceDrawTiming_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698