| Index: chrome/browser/android/vr_shell/vr_gl_thread.h
|
| diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.h b/chrome/browser/android/vr_shell/vr_gl_thread.h
|
| index 9e35938f3b427a7c9aa092ddaf9468bc8c226b84..4bedaa380835a44e13c3f6933a25fc93183499c6 100644
|
| --- a/chrome/browser/android/vr_shell/vr_gl_thread.h
|
| +++ b/chrome/browser/android/vr_shell/vr_gl_thread.h
|
| @@ -11,6 +11,7 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/threading/thread.h"
|
| +#include "chrome/browser/android/vr_shell/vr_thread_envoy.h"
|
| #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h"
|
|
|
| namespace vr_shell {
|
| @@ -20,7 +21,7 @@ class UiSceneManager;
|
| class VrShell;
|
| class VrShellGl;
|
|
|
| -class VrGLThread : public base::Thread {
|
| +class VrGLThread : public VrThreadEnvoy, public base::Thread {
|
| public:
|
| VrGLThread(
|
| const base::WeakPtr<VrShell>& weak_vr_shell,
|
| @@ -30,11 +31,17 @@ class VrGLThread : public base::Thread {
|
| bool reprojected_rendering);
|
|
|
| ~VrGLThread() override;
|
| + void PostToMainThread(const base::Closure& task);
|
| base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; }
|
| base::WeakPtr<UiSceneManager> GetSceneManager() {
|
| return weak_scene_manager_;
|
| }
|
|
|
| + // VrThreadEnvoy implementation.
|
| + base::WeakPtr<VrShell> GetVrShell() override;
|
| + scoped_refptr<base::SingleThreadTaskRunner> GetMainThreadTaskRunner()
|
| + override;
|
| +
|
| protected:
|
| void Init() override;
|
| void CleanUp() override;
|
| @@ -54,6 +61,8 @@ class VrGLThread : public base::Thread {
|
| bool initially_web_vr_;
|
| bool reprojected_rendering_;
|
|
|
| + base::WeakPtrFactory<VrGLThread> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(VrGLThread);
|
| };
|
|
|
|
|