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

Side by Side Diff: chrome/browser/android/vr_shell/vr_gl_thread.h

Issue 2658643003: Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations. (Closed)
Patch Set: Address comments Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 13 matching lines...) Expand all
24 VrGLThread( 24 VrGLThread(
25 const base::WeakPtr<VrShell>& weak_vr_shell, 25 const base::WeakPtr<VrShell>& weak_vr_shell,
26 const base::WeakPtr<VrShellDelegate>& delegate_provider, 26 const base::WeakPtr<VrShellDelegate>& delegate_provider,
27 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, 27 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
28 gvr_context* gvr_api, 28 gvr_context* gvr_api,
29 bool initially_web_vr, 29 bool initially_web_vr,
30 bool reprojected_rendering); 30 bool reprojected_rendering);
31 31
32 ~VrGLThread() override; 32 ~VrGLThread() override;
33 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } 33 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; }
34 VrShellGl* GetVrShellGlUnsafe() { return vr_shell_gl_.get(); }
35 34
36 protected: 35 protected:
37 void Init() override; 36 void Init() override;
38 void CleanUp() override; 37 void CleanUp() override;
39 38
40 private: 39 private:
41 // Created on GL thread. 40 // Created on GL thread.
42 std::unique_ptr<VrShellGl> vr_shell_gl_; 41 std::unique_ptr<VrShellGl> vr_shell_gl_;
43 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; 42 base::WeakPtr<VrShellGl> weak_vr_shell_gl_;
44 43
45 // This state is used for initializing vr_shell_gl_. 44 // This state is used for initializing vr_shell_gl_.
46 base::WeakPtr<VrShell> weak_vr_shell_; 45 base::WeakPtr<VrShell> weak_vr_shell_;
47 base::WeakPtr<VrShellDelegate> delegate_provider_; 46 base::WeakPtr<VrShellDelegate> delegate_provider_;
48 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 47 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
49 gvr_context* gvr_api_; 48 gvr_context* gvr_api_;
50 bool initially_web_vr_; 49 bool initially_web_vr_;
51 bool reprojected_rendering_; 50 bool reprojected_rendering_;
52 51
53 DISALLOW_COPY_AND_ASSIGN(VrGLThread); 52 DISALLOW_COPY_AND_ASSIGN(VrGLThread);
54 }; 53 };
55 54
56 } // namespace vr_shell 55 } // namespace vr_shell
57 56
58 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ 57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.cc ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698