Index: Source/modules/screen_orientation/ScreenOrientation.cpp |
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp |
index 0172e47e2fe29d1d00ef5bd28a7fd6826cbd2f87..08076c116c96590b03d3609cafcd37c0b82b7b94 100644 |
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp |
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp |
@@ -11,6 +11,7 @@ |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
#include "core/frame/LocalFrame.h" |
+#include "core/frame/UseCounter.h" |
#include "modules/EventTargetModules.h" |
#include "modules/screen_orientation/LockOrientationCallback.h" |
#include "modules/screen_orientation/ScreenOrientationController.h" |
@@ -126,11 +127,15 @@ ExecutionContext* ScreenOrientation::executionContext() const |
String ScreenOrientation::type() const |
{ |
+ if (m_frame) |
Peter Beverloo
2014/10/02 12:30:07
Please move these to ScreenOrientation.idl using t
|
+ UseCounter::count(m_frame->document(), UseCounter::ScreenOrientationType); |
return orientationTypeToString(m_type); |
} |
unsigned short ScreenOrientation::angle() const |
{ |
+ if (m_frame) |
+ UseCounter::count(m_frame->document(), UseCounter::ScreenOrientationAngle); |
return m_angle; |
} |
@@ -150,6 +155,7 @@ ScriptPromise ScreenOrientation::lock(ScriptState* state, const AtomicString& lo |
ScriptPromise promise = resolver->promise(); |
Document* document = m_frame ? m_frame->document() : 0; |
+ UseCounter::count(document, UseCounter::ScreenOrientationLock); |
if (!document || !controller()) { |
RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(InvalidStateError, "The object is no longer associated to a document."); |