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

Unified Diff: Source/core/timing/PerformanceBase.h

Issue 1100813004: Offer User Timing in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: Source/core/timing/PerformanceBase.h
diff --git a/Source/core/timing/Performance.h b/Source/core/timing/PerformanceBase.h
similarity index 78%
copy from Source/core/timing/Performance.h
copy to Source/core/timing/PerformanceBase.h
index 4510e96b2373d9917cfda202ca30414f9221220c..edbfa18c502863701ce4a4ab86745cde11546861 100644
--- a/Source/core/timing/Performance.h
+++ b/Source/core/timing/PerformanceBase.h
@@ -29,16 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Performance_h
-#define Performance_h
+#ifndef PerformanceBase_h
+#define PerformanceBase_h
#include "core/CoreExport.h"
#include "core/events/EventTarget.h"
-#include "core/frame/DOMWindowProperty.h"
-#include "core/timing/MemoryInfo.h"
#include "core/timing/PerformanceEntry.h"
-#include "core/timing/PerformanceNavigation.h"
-#include "core/timing/PerformanceTiming.h"
#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
@@ -48,30 +44,25 @@ namespace blink {
class Document;
class ExceptionState;
+class PerformanceTiming;
class ResourceTimingInfo;
class UserTiming;
using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>;
-class CORE_EXPORT Performance final : public RefCountedGarbageCollectedEventTargetWithInlineData<Performance>, public DOMWindowProperty {
- DEFINE_WRAPPERTYPEINFO();
- DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<Performance>);
- WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Performance);
+class CORE_EXPORT PerformanceBase : public RefCountedGarbageCollectedEventTargetWithInlineData<PerformanceBase> {
+ DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<PerformanceBase>);
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PerformanceBase);
public:
- static Performance* create(LocalFrame* frame)
- {
- return new Performance(frame);
- }
- virtual ~Performance();
+ virtual ~PerformanceBase();
virtual const AtomicString& interfaceName() const override;
- virtual ExecutionContext* executionContext() const override;
- MemoryInfo* memory();
- PerformanceNavigation* navigation() const;
- PerformanceTiming* timing() const;
+ virtual PerformanceTiming* timing() const;
double now() const;
+ double timeOrigin() const { return m_timeOrigin; }
+
PerformanceEntryVector getEntries() const;
PerformanceEntryVector getEntriesByType(const String& entryType);
PerformanceEntryVector getEntriesByName(const String& name, const String& entryType);
@@ -100,15 +91,11 @@ public:
DECLARE_VIRTUAL_TRACE();
-private:
- explicit Performance(LocalFrame*);
-
+protected:
+ PerformanceBase(double timeOrigin);
kinuko 2015/06/04 08:21:23 nit: explicit
Kunihiko Sakamoto 2015/06/05 03:43:56 Done. Always I forget it...
bool isResourceTimingBufferFull();
void addResourceTimingBuffer(PerformanceEntry*);
- mutable Member<PerformanceNavigation> m_navigation;
- mutable Member<PerformanceTiming> m_timing;
-
bool isFrameTimingBufferFull();
void addFrameTimingBuffer(PerformanceEntry*);
@@ -116,12 +103,11 @@ private:
unsigned m_frameTimingBufferSize;
PerformanceEntryVector m_resourceTimingBuffer;
unsigned m_resourceTimingBufferSize;
- double m_referenceTime;
+ double m_timeOrigin;
- Member<MemoryInfo> m_memoryInfo;
Member<UserTiming> m_userTiming;
};
} // namespace blink
-#endif // Performance_h
+#endif // PerformanceBase_h

Powered by Google App Engine
This is Rietveld 408576698