Index: Source/modules/performance/WorkerPerformance.cpp |
diff --git a/Source/core/html/ime/Composition.cpp b/Source/modules/performance/WorkerPerformance.cpp |
similarity index 71% |
copy from Source/core/html/ime/Composition.cpp |
copy to Source/modules/performance/WorkerPerformance.cpp |
index e74501bcd8637afa85872dae701e91f04827e1ee..21911532a910a86e10507e9c71a8f576bd588c36 100644 |
--- a/Source/core/html/ime/Composition.cpp |
+++ b/Source/modules/performance/WorkerPerformance.cpp |
@@ -29,27 +29,30 @@ |
*/ |
#include "config.h" |
-#include "core/html/ime/Composition.h" |
+#include "modules/performance/WorkerPerformance.h" |
-#include "core/dom/Node.h" |
-#include "core/dom/Range.h" |
+#include "core/workers/DedicatedWorkerContext.h" |
+#include "core/workers/WorkerContext.h" |
+#include "wtf/CurrentTime.h" |
namespace WebCore { |
-Composition::~Composition() |
+WorkerPerformance::WorkerPerformance(ScriptExecutionContext* context) |
+ : ContextDestructionObserver(context) |
{ |
} |
-PassRefPtr<Composition> Composition::create(Node* text, Range* caret) |
+WorkerPerformance::~WorkerPerformance() |
{ |
- return adoptRef(new Composition(text, caret)); |
} |
-Composition::Composition(Node* text, Range* caret) |
- : m_text(text) |
- , m_caret(caret) |
+double WorkerPerformance::now() const |
{ |
- ScriptWrappable::init(this); |
+ ScriptExecutionContext* context = scriptExecutionContext(); |
+ ASSERT(context); |
+ ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerContext()); |
+ WorkerContext* workerContext = static_cast<WorkerContext*>(context); |
+ return 1000.0 * (monotonicallyIncreasingTime() - workerContext->timeOrigin()); |
abarth-chromium
2013/06/13 22:27:16
I missed it the first time too, but it's here on t
|
} |
} // namespace WebCore |