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

Unified Diff: content/browser/screen_orientation/screen_orientation_provider_android.cc

Issue 410173002: Make ScreenOrientationProvider (Java) a bag of static methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: content/browser/screen_orientation/screen_orientation_provider_android.cc
diff --git a/content/browser/screen_orientation/screen_orientation_provider_android.cc b/content/browser/screen_orientation/screen_orientation_provider_android.cc
index 367eff5194f608f2a6ade86038b2b858bff5426d..36064a69371e5744fbff6f10f50392d20ba6686d 100644
--- a/content/browser/screen_orientation/screen_orientation_provider_android.cc
+++ b/content/browser/screen_orientation/screen_orientation_provider_android.cc
@@ -69,15 +69,9 @@ void ScreenOrientationProviderAndroid::LockOrientation(
}
}
- if (j_screen_orientation_provider_.is_null()) {
- j_screen_orientation_provider_.Reset(Java_ScreenOrientationProvider_create(
- base::android::AttachCurrentThread()));
- }
-
lock_applied_ = true;
Java_ScreenOrientationProvider_lockOrientation(
- base::android::AttachCurrentThread(),
- j_screen_orientation_provider_.obj(), lock_orientation);
+ base::android::AttachCurrentThread(), lock_orientation);
// If two calls happen close to each other, Android will ignore the first.
if (pending_lock_) {
@@ -99,12 +93,8 @@ void ScreenOrientationProviderAndroid::UnlockOrientation() {
if (!lock_applied_)
return;
- // j_screen_orientation_provider_ was set when locking so it can't be null.
- DCHECK(!j_screen_orientation_provider_.is_null());
-
Java_ScreenOrientationProvider_unlockOrientation(
- base::android::AttachCurrentThread(),
- j_screen_orientation_provider_.obj());
+ base::android::AttachCurrentThread());
lock_applied_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698