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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_delegate.h

Issue 2570553004: Clean up some VrShell threading issues and remove unnecessary WeakPtr types. (Closed)
Patch Set: Created 4 years 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: chrome/browser/android/vr_shell/vr_shell_delegate.h
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.h b/chrome/browser/android/vr_shell/vr_shell_delegate.h
index 97bf2bb8ea5456ffc91961836b825330d798458b..3731bb2f7972489e448db590fe0c1d245c7dc6e3 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.h
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -24,28 +24,28 @@ class VrShellDelegate : public device::GvrDelegateProvider {
static VrShellDelegate* GetNativeDelegate(JNIEnv* env, jobject jdelegate);
- void SetDelegate(const base::WeakPtr<device::GvrDelegate>& delegate);
+ void SetDelegate(device::GvrDelegate* delegate);
void RemoveDelegate();
void SetPresentResult(JNIEnv* env, jobject obj, jboolean result);
void DisplayActivate(JNIEnv* env, jobject obj);
void ForceExitVr();
+ device::GvrDeviceProvider* device_provider() { return device_provider_; }
// device::GvrDelegateProvider implementation
- void SetDeviceProvider(
- base::WeakPtr<device::GvrDeviceProvider> device_provider) override;
+ void SetDeviceProvider(device::GvrDeviceProvider* device_provider) override;
void RequestWebVRPresent(const base::Callback<void(bool)>& callback) override;
void ExitWebVRPresent() override;
- base::WeakPtr<device::GvrDelegate> GetNonPresentingDelegate() override;
+ device::GvrDelegate* GetNonPresentingDelegate() override;
void DestroyNonPresentingDelegate() override;
void SetListeningForActivate(bool listening) override;
private:
std::unique_ptr<device::GvrDelegate> non_presenting_delegate_;
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
- base::WeakPtr<device::GvrDeviceProvider> device_provider_;
- base::WeakPtr<device::GvrDelegate> delegate_;
+ device::GvrDeviceProvider* device_provider_ = nullptr;
+ device::GvrDelegate* delegate_ = nullptr;
base::Callback<void(bool)> present_callback_;
DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);

Powered by Google App Engine
This is Rietveld 408576698