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

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

Issue 647933003: Disconnect from WebScreenOrientationClient when frame is detached. (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/modules/screen_orientation/ScreenOrientationController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/screen_orientation/ScreenOrientationController.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientationController.cpp b/Source/modules/screen_orientation/ScreenOrientationController.cpp
index 1c068bcd647e82b786134668b913f8a4797f99a8..6a354383f22bdb4b1e7969023375e74bb655d124 100644
--- a/Source/modules/screen_orientation/ScreenOrientationController.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientationController.cpp
@@ -155,13 +155,17 @@ void ScreenOrientationController::setOrientation(ScreenOrientation* orientation)
void ScreenOrientationController::lock(WebScreenOrientationLockType orientation, WebLockOrientationCallback* callback)
{
- ASSERT(m_client);
+ // When detached, the client is no longer valid.
+ if (!m_client)
+ return;
m_client->lockOrientation(orientation, callback);
}
void ScreenOrientationController::unlock()
{
- ASSERT(m_client);
+ // When detached, the client is no longer valid.
+ if (!m_client)
+ return;
m_client->unlockOrientation();
}
@@ -192,6 +196,11 @@ bool ScreenOrientationController::hasLastData()
return true;
}
+void ScreenOrientationController::willDetachFrameHost()
+{
+ m_client = nullptr;
+}
+
void ScreenOrientationController::notifyDispatcher()
{
if (m_orientation && page()->visibilityState() == PageVisibilityStateVisible)
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientationController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698