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

Unified Diff: device/vr/vr_display_impl.h

Issue 2510873003: Clean up WebVR RequestPresent and make callback asynchronous. (Closed)
Patch Set: Created 4 years, 1 month 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: device/vr/vr_display_impl.h
diff --git a/device/vr/vr_display_impl.h b/device/vr/vr_display_impl.h
index dcfe0957619b8b3e4d37127b33992fd59d2c7e62..cd9b302370ff751de1e98560d0e88d92ecfa4433 100644
--- a/device/vr/vr_display_impl.h
+++ b/device/vr/vr_display_impl.h
@@ -8,7 +8,7 @@
#include <memory>
#include "base/macros.h"
-
+#include "base/memory/weak_ptr.h"
#include "device/vr/vr_device.h"
#include "device/vr/vr_export.h"
#include "device/vr/vr_service.mojom.h"
@@ -29,7 +29,7 @@ class VRDisplayImpl : public mojom::VRDisplay {
void GetPose(const GetPoseCallback& callback) override;
void ResetPose() override;
- void RequestPresent(bool secureOrigin,
+ void RequestPresent(bool secure_origin,
const RequestPresentCallback& callback) override;
void ExitPresent() override;
void SubmitFrame(mojom::VRPosePtr pose) override;
@@ -37,10 +37,16 @@ class VRDisplayImpl : public mojom::VRDisplay {
void UpdateLayerBounds(mojom::VRLayerBoundsPtr left_bounds,
mojom::VRLayerBoundsPtr right_bounds) override;
+ void RequestPresentResult(const RequestPresentCallback& callback,
+ bool secure_origin,
+ bool success);
+
mojo::Binding<mojom::VRDisplay> binding_;
mojom::VRDisplayClientPtr client_;
device::VRDevice* device_;
VRServiceImpl* service_;
+
+ base::WeakPtrFactory<VRDisplayImpl> weak_ptr_factory_;
};
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698