| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include <wtf/PassRefPtr.h> | 42 #include <wtf/PassRefPtr.h> |
| 43 #include <wtf/RefCounted.h> | 43 #include <wtf/RefCounted.h> |
| 44 #include <wtf/RefPtr.h> | 44 #include <wtf/RefPtr.h> |
| 45 #include <wtf/text/WTFString.h> | 45 #include <wtf/text/WTFString.h> |
| 46 | 46 |
| 47 namespace WebCore { | 47 namespace WebCore { |
| 48 | 48 |
| 49 class Document; | 49 class Document; |
| 50 class ResourceRequest; | 50 class ResourceRequest; |
| 51 class ResourceResponse; | 51 class ResourceResponse; |
| 52 class ResourceTimingInfo; | |
| 53 class UserTiming; | 52 class UserTiming; |
| 54 | 53 |
| 55 class Performance : public ScriptWrappable, public RefCounted<Performance>, publ
ic DOMWindowProperty, public EventTarget { | 54 class Performance : public ScriptWrappable, public RefCounted<Performance>, publ
ic DOMWindowProperty, public EventTarget { |
| 56 public: | 55 public: |
| 57 static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Pe
rformance(frame)); } | 56 static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Pe
rformance(frame)); } |
| 58 ~Performance(); | 57 ~Performance(); |
| 59 | 58 |
| 60 virtual const AtomicString& interfaceName() const; | 59 virtual const AtomicString& interfaceName() const; |
| 61 virtual ScriptExecutionContext* scriptExecutionContext() const; | 60 virtual ScriptExecutionContext* scriptExecutionContext() const; |
| 62 | 61 |
| 63 PassRefPtr<MemoryInfo> memory() const; | 62 PassRefPtr<MemoryInfo> memory() const; |
| 64 PerformanceNavigation* navigation() const; | 63 PerformanceNavigation* navigation() const; |
| 65 PerformanceTiming* timing() const; | 64 PerformanceTiming* timing() const; |
| 66 double now() const; | 65 double now() const; |
| 67 | 66 |
| 68 Vector<RefPtr<PerformanceEntry> > getEntries() const; | 67 Vector<RefPtr<PerformanceEntry> > getEntries() const; |
| 69 Vector<RefPtr<PerformanceEntry> > getEntriesByType(const String& entryType); | 68 Vector<RefPtr<PerformanceEntry> > getEntriesByType(const String& entryType); |
| 70 Vector<RefPtr<PerformanceEntry> > getEntriesByName(const String& name, const
String& entryType); | 69 Vector<RefPtr<PerformanceEntry> > getEntriesByName(const String& name, const
String& entryType); |
| 71 | 70 |
| 72 void webkitClearResourceTimings(); | 71 void webkitClearResourceTimings(); |
| 73 void webkitSetResourceTimingBufferSize(unsigned int); | 72 void webkitSetResourceTimingBufferSize(unsigned int); |
| 74 | 73 |
| 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitresourcetimingbufferfull); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitresourcetimingbufferfull); |
| 76 | 75 |
| 77 void addResourceTiming(const ResourceTimingInfo&, Document*); | 76 void addResourceTiming(const String& initiatorName, Document*, const Resourc
eRequest&, const ResourceResponse&, double initiationTime, double finishTime); |
| 78 | 77 |
| 79 using RefCounted<Performance>::ref; | 78 using RefCounted<Performance>::ref; |
| 80 using RefCounted<Performance>::deref; | 79 using RefCounted<Performance>::deref; |
| 81 | 80 |
| 82 void mark(const String& markName, ExceptionCode&); | 81 void mark(const String& markName, ExceptionCode&); |
| 83 void clearMarks(const String& markName); | 82 void clearMarks(const String& markName); |
| 84 | 83 |
| 85 void measure(const String& measureName, const String& startMark, const Strin
g& endMark, ExceptionCode&); | 84 void measure(const String& measureName, const String& startMark, const Strin
g& endMark, ExceptionCode&); |
| 86 void clearMeasures(const String& measureName); | 85 void clearMeasures(const String& measureName); |
| 87 | 86 |
| 88 private: | 87 private: |
| 89 explicit Performance(Frame*); | 88 explicit Performance(Frame*); |
| 90 | 89 |
| 91 virtual void refEventTarget() { ref(); } | 90 virtual void refEventTarget() { ref(); } |
| 92 virtual void derefEventTarget() { deref(); } | 91 virtual void derefEventTarget() { deref(); } |
| 93 virtual EventTargetData* eventTargetData(); | 92 virtual EventTargetData* eventTargetData(); |
| 94 virtual EventTargetData* ensureEventTargetData(); | 93 virtual EventTargetData* ensureEventTargetData(); |
| 95 bool isResourceTimingBufferFull(); | 94 bool isResourceTimingBufferFull(); |
| 96 void addResourceTimingBuffer(PassRefPtr<PerformanceEntry>); | |
| 97 | 95 |
| 98 EventTargetData m_eventTargetData; | 96 EventTargetData m_eventTargetData; |
| 99 | 97 |
| 100 mutable RefPtr<PerformanceNavigation> m_navigation; | 98 mutable RefPtr<PerformanceNavigation> m_navigation; |
| 101 mutable RefPtr<PerformanceTiming> m_timing; | 99 mutable RefPtr<PerformanceTiming> m_timing; |
| 102 | 100 |
| 103 Vector<RefPtr<PerformanceEntry> > m_resourceTimingBuffer; | 101 Vector<RefPtr<PerformanceEntry> > m_resourceTimingBuffer; |
| 104 unsigned m_resourceTimingBufferSize; | 102 unsigned m_resourceTimingBufferSize; |
| 105 | 103 |
| 106 RefPtr<UserTiming> m_userTiming; | 104 RefPtr<UserTiming> m_userTiming; |
| 107 }; | 105 }; |
| 108 | 106 |
| 109 } | 107 } |
| 110 | 108 |
| 111 #endif // Performance_h | 109 #endif // Performance_h |
| OLD | NEW |