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

Unified Diff: Source/modules/performance/WorkerPerformance.h

Issue 16434011: Support performance.now() in workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 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/modules/performance/WorkerPerformance.h
diff --git a/Source/core/html/ime/Composition.h b/Source/modules/performance/WorkerPerformance.h
similarity index 76%
copy from Source/core/html/ime/Composition.h
copy to Source/modules/performance/WorkerPerformance.h
index 6562b5f75fd19cc8e80409327f7f8a5881bcf1df..86245992cc081e069ec1d717cce5b40b4ec4129f 100644
--- a/Source/core/html/ime/Composition.h
+++ b/Source/modules/performance/WorkerPerformance.h
@@ -28,34 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Composition_h
-#define Composition_h
+#ifndef WorkerPerformance_h
+#define WorkerPerformance_h
-#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/ContextDestructionObserver.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
namespace WebCore {
-class Node;
-class Range;
+class ScriptExecutionContext;
-class Composition : public RefCounted<Composition>, public ScriptWrappable {
+class WorkerPerformance : public RefCounted<WorkerPerformance>, public ContextDestructionObserver {
levin 2013/06/13 19:55:22 How does this use ContextDestructionObserver? How
abarth-chromium 2013/06/13 20:18:19 The pointer to the ScriptExecutionContext is store
levin 2013/06/13 22:19:08 ok. Somehow I missed the usage of sec completely.
public:
- static PassRefPtr<Composition> create(Node*, Range*);
- ~Composition();
+ static PassRefPtr<WorkerPerformance> create(ScriptExecutionContext* context) { return adoptRef(new WorkerPerformance(context)); }
+ ~WorkerPerformance();
- Node* text() const { return m_text.get(); }
- Range* caret() const { return m_caret.get(); }
+ double now() const;
private:
- Composition(Node*, Range*);
-
- RefPtr<Node> m_text;
- RefPtr<Range> m_caret;
+ explicit WorkerPerformance(ScriptExecutionContext*);
};
-} // namespace WebCore
+}
-#endif // Composition_h
+#endif // WorkerPerformance_h

Powered by Google App Engine
This is Rietveld 408576698