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

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

Issue 2570553004: Clean up some VrShell threading issues and remove unnecessary WeakPtr types. (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SHELL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SubmitWebVRFrame() override; 98 void SubmitWebVRFrame() override;
99 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, 99 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds,
100 const gvr::Rectf& right_bounds) override; 100 const gvr::Rectf& right_bounds) override;
101 gvr::GvrApi* gvr_api() override; 101 gvr::GvrApi* gvr_api() override;
102 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override; 102 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override;
103 void SetWebVRRenderSurfaceSize(int width, int height) override; 103 void SetWebVRRenderSurfaceSize(int width, int height) override;
104 gvr::Sizei GetWebVRCompositorSurfaceSize() override; 104 gvr::Sizei GetWebVRCompositorSurfaceSize() override;
105 105
106 void SurfacesChanged(jobject content_surface, jobject ui_surface); 106 void SurfacesChanged(jobject content_surface, jobject ui_surface);
107 void GvrDelegateReady(); 107 void GvrDelegateReady();
108 void AppButtonPressed();
108 109
109 void ContentBoundsChanged( 110 void ContentBoundsChanged(
110 JNIEnv* env, 111 JNIEnv* env,
111 const base::android::JavaParamRef<jobject>& object, 112 const base::android::JavaParamRef<jobject>& object,
112 jint width, jint height, jfloat dpr); 113 jint width, jint height, jfloat dpr);
113 114
114 void UIBoundsChanged( 115 void UIBoundsChanged(
115 JNIEnv* env, 116 JNIEnv* env,
116 const base::android::JavaParamRef<jobject>& object, 117 const base::android::JavaParamRef<jobject>& object,
117 jint width, jint height, jfloat dpr); 118 jint width, jint height, jfloat dpr);
118 119
119 void UpdateScene(const base::ListValue* args); 120 void UpdateScene(const base::ListValue* args);
120 121
121 // Perform a UI action triggered by the javascript API. 122 // Perform a UI action triggered by the javascript API.
122 void DoUiAction(const UiAction action); 123 void DoUiAction(const UiAction action);
123 124
124 void SetContentCssSize(float width, float height, float dpr); 125 void SetContentCssSize(float width, float height, float dpr);
125 void SetUiCssSize(float width, float height, float dpr); 126 void SetUiCssSize(float width, float height, float dpr);
126 127
127 void ContentFrameWasResized(bool width_changed); 128 void ContentFrameWasResized(bool width_changed);
128 129
129 void ForceExitVr(); 130 void ForceExitVr();
130 131
131 private: 132 private:
132 ~VrShell() override; 133 ~VrShell() override;
133 void SetShowingOverscrollGlow(bool showing_glow); 134 void SetShowingOverscrollGlow(bool showing_glow);
135 void PostToGlThreadWhenReady(const base::Closure& task);
134 136
135 // content::WebContentsObserver implementation. All called on UI thread. 137 // content::WebContentsObserver implementation. All called on UI thread.
136 void RenderViewHostChanged(content::RenderViewHost* old_host, 138 void RenderViewHostChanged(content::RenderViewHost* old_host,
137 content::RenderViewHost* new_host) override; 139 content::RenderViewHost* new_host) override;
138 void MainFrameWasResized(bool width_changed) override; 140 void MainFrameWasResized(bool width_changed) override;
139 void WebContentsDestroyed() override; 141 void WebContentsDestroyed() override;
140 142
141 std::unique_ptr<UiInterface> html_interface_; 143 std::unique_ptr<UiInterface> html_interface_;
142 144
143 content::WebContents* main_contents_; 145 content::WebContents* main_contents_;
(...skipping 16 matching lines...) Expand all
160 base::WeakPtrFactory<VrShell> weak_ptr_factory_; 162 base::WeakPtrFactory<VrShell> weak_ptr_factory_;
161 163
162 DISALLOW_COPY_AND_ASSIGN(VrShell); 164 DISALLOW_COPY_AND_ASSIGN(VrShell);
163 }; 165 };
164 166
165 bool RegisterVrShell(JNIEnv* env); 167 bool RegisterVrShell(JNIEnv* env);
166 168
167 } // namespace vr_shell 169 } // namespace vr_shell
168 170
169 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 171 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698