Index: Source/core/timing/PerformanceCompositeTiming.cpp |
diff --git a/Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp b/Source/core/timing/PerformanceCompositeTiming.cpp |
similarity index 60% |
copy from Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp |
copy to Source/core/timing/PerformanceCompositeTiming.cpp |
index a08172e509d4836d1561d502f44afe8b42720fd0..856476962040207b75d2c22671f5d4a967612b97 100644 |
--- a/Source/bindings/core/v8/custom/V8MediaQueryListCustom.cpp |
+++ b/Source/core/timing/PerformanceCompositeTiming.cpp |
@@ -1,5 +1,6 @@ |
/* |
* Copyright (C) 2015 Google Inc. All rights reserved. |
+ * Copyright (C) 2015 Intel Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -29,20 +30,39 @@ |
*/ |
#include "config.h" |
-#include "bindings/core/v8/V8MediaQueryList.h" |
+#include "core/timing/PerformanceCompositeTiming.h" |
+ |
+#include "core/dom/Document.h" |
+#include "core/loader/DocumentLoader.h" |
namespace blink { |
-void V8MediaQueryList::addListenerMethodEpilogueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, MediaQueryList* impl) |
+static double monotonicTimeToDocumentMilliseconds(Document* document, double seconds) |
+{ |
+ ASSERT(seconds >= 0.0); |
+ return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(seconds) * 1000.0; |
+} |
+ |
+PerformanceCompositeTiming::PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime) |
+ : PerformanceEntry(requestingDocument->url().string(), "composite", monotonicTimeToDocumentMilliseconds(requestingDocument, startTime), monotonicTimeToDocumentMilliseconds(requestingDocument, startTime)) |
+ , m_sourceFrame(sourceFrame) |
+ , m_requestingDocument(requestingDocument) |
+{ |
+} |
+ |
+PerformanceCompositeTiming::~PerformanceCompositeTiming() |
+{ |
+} |
+ |
+unsigned PerformanceCompositeTiming::sourceFrame() const |
{ |
- if (info.Length() >= 1 && info[0]->IsObject() && !impl->toNode()) |
- addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[0], V8EventTarget::eventListenerCacheIndex); |
+ return m_sourceFrame; |
} |
-void V8MediaQueryList::removeListenerMethodEpilogueCustom(const v8::FunctionCallbackInfo<v8::Value>& info, MediaQueryList* impl) |
+DEFINE_TRACE(PerformanceCompositeTiming) |
{ |
- if (info.Length() >= 1 && info[0]->IsObject() && !impl->toNode()) |
- removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[0], V8EventTarget::eventListenerCacheIndex); |
+ visitor->trace(m_requestingDocument); |
+ PerformanceEntry::trace(visitor); |
} |
} // namespace blink |