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

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

Issue 2658643003: Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations. (Closed)
Patch Set: Address comments Created 3 years, 11 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 | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8067a412fdf76538cc0f11a970df54aa4783f6eb..de0e2c0d6c6bb9b3c07dc9be625848e82bbd7c0b 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.h
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -25,9 +25,10 @@ class VrShellDelegate : public device::GvrDelegateProvider {
VrShellDelegate(JNIEnv* env, jobject obj);
~VrShellDelegate() override;
- static VrShellDelegate* GetNativeDelegate(JNIEnv* env, jobject jdelegate);
+ static VrShellDelegate* GetNativeVrShellDelegate(JNIEnv* env,
+ jobject jdelegate);
- void SetDelegate(device::GvrDelegate* delegate);
+ void SetDelegate(device::GvrDelegate* delegate, gvr_context* context);
void RemoveDelegate();
void SetPresentResult(JNIEnv* env,
@@ -49,12 +50,14 @@ class VrShellDelegate : public device::GvrDelegateProvider {
private:
// device::GvrDelegateProvider implementation
void SetDeviceProvider(device::GvrDeviceProvider* device_provider) override;
+ void ClearDeviceProvider() override;
void RequestWebVRPresent(const base::Callback<void(bool)>& callback) override;
void ExitWebVRPresent() override;
- device::GvrDelegate* GetNonPresentingDelegate() override;
- void DestroyNonPresentingDelegate() override;
+ device::GvrDelegate* GetDelegate() override;
void SetListeningForActivate(bool listening) override;
+ void CreateNonPresentingDelegate();
+
std::unique_ptr<NonPresentingGvrDelegate> non_presenting_delegate_;
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_;
device::GvrDeviceProvider* device_provider_ = nullptr;
@@ -63,6 +66,10 @@ class VrShellDelegate : public device::GvrDelegateProvider {
long timebase_nanos_ = 0;
double interval_seconds_ = 0;
+ // TODO(mthiesse): Remove the need for this to be stored here.
+ // crbug.com/674594
+ gvr_context* context_ = nullptr;
+
base::WeakPtrFactory<VrShellDelegate> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698