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

Unified Diff: third_party/WebKit/Source/core/frame/DOMVisualViewport.h

Issue 2070563002: Seperate DOMVisualViewport from Blink's VisualViewport class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/core/frame/DOMVisualViewport.h
diff --git a/third_party/WebKit/Source/core/timing/WorkerPerformance.h b/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
similarity index 68%
copy from third_party/WebKit/Source/core/timing/WorkerPerformance.h
copy to third_party/WebKit/Source/core/frame/DOMVisualViewport.h
index fd46d569547d0270b1149fad1544088a09c91a0f..e671cc547fc47491ca1a057ca74f04e6d71242a7 100644
--- a/third_party/WebKit/Source/core/timing/WorkerPerformance.h
+++ b/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2016 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,40 +28,44 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WorkerPerformance_h
-#define WorkerPerformance_h
+#ifndef DOMVisualViewport_h
+#define DOMVisualViewport_h
#include "bindings/core/v8/ScriptWrappable.h"
-#include "core/dom/ContextLifecycleObserver.h"
-#include "core/timing/PerformanceBase.h"
+#include "core/frame/LocalDOMWindow.h"
bokan 2016/06/16 07:22:44 You should be able to forward declare this.
ymalik 2016/06/20 15:52:56 Done.
#include "platform/heap/Handle.h"
-#include "wtf/Forward.h"
namespace blink {
-class ExecutionContext;
-class MemoryInfo;
-class WorkerGlobalScope;
-
-class WorkerPerformance final : public PerformanceBase, public ContextLifecycleObserver {
+class DOMVisualViewport final
+ : public GarbageCollected<DOMVisualViewport>
+ , public ScriptWrappable
+ , public GarbageCollectedMixin {
bokan 2016/06/16 07:22:43 You don't need the Mixin class.
ymalik 2016/06/20 15:52:56 You're right!
DEFINE_WRAPPERTYPEINFO();
- USING_GARBAGE_COLLECTED_MIXIN(WorkerPerformance);
+ USING_GARBAGE_COLLECTED_MIXIN(DOMVisualViewport);
bokan 2016/06/16 07:22:43 Don't need this
ymalik 2016/06/20 15:52:56 Done.
public:
- static WorkerPerformance* create(WorkerGlobalScope* context)
+ static DOMVisualViewport* create(LocalDOMWindow* window)
{
- return new WorkerPerformance(context);
+ return new DOMVisualViewport(window);
}
- ExecutionContext* getExecutionContext() const override;
-
- MemoryInfo* memory();
-
DECLARE_VIRTUAL_TRACE();
+ double scrollLeft();
+ double scrollTop();
+ void setScrollLeft(double x);
+ void setScrollTop(double y);
+ double clientWidth();
+ double clientHeight();
+ double pageScale();
+
private:
- explicit WorkerPerformance(WorkerGlobalScope*);
+ explicit DOMVisualViewport(LocalDOMWindow*);
+
+ bool isMainFrame() const;
+ Member<LocalDOMWindow> m_window;
};
} // namespace blink
-#endif // WorkerPerformance_h
+#endif // DOMVisualViewport_h

Powered by Google App Engine
This is Rietveld 408576698