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

Unified Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 625443004: [ScreenOrientation] Add use counters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/modules/screen_orientation/ScreenScreenOrientation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/modules/screen_orientation/ScreenScreenOrientation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698