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

Unified Diff: device/vr/android/gvr/gvr_gamepad_data_fetcher.cc

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: rebase 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
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.h ('k') | device/vr/test/fake_vr_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
diff --git a/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc b/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
index 17bc49a7a358822c037493cbef2544a44c8ec9dd..219897a60bc8a0a15bbe6f11ccf5b7289bd3cf0d 100644
--- a/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
+++ b/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
@@ -28,16 +28,18 @@ void CopyToWebUString(blink::WebUChar* dest,
using namespace blink;
-GvrGamepadDataFetcher::Factory::Factory(GvrDelegate* delegate,
- unsigned int display_id)
+GvrGamepadDataFetcher::Factory::Factory(
+ const base::WeakPtr<GvrDelegate>& delegate,
+ unsigned int display_id)
: delegate_(delegate), display_id_(display_id) {}
GvrGamepadDataFetcher::Factory::~Factory() {}
std::unique_ptr<GamepadDataFetcher>
GvrGamepadDataFetcher::Factory::CreateDataFetcher() {
- return std::unique_ptr<GamepadDataFetcher>(
- new GvrGamepadDataFetcher(delegate_, display_id_));
+ if (!delegate_)
+ return nullptr;
+ return base::MakeUnique<GvrGamepadDataFetcher>(delegate_.get(), display_id_);
}
GamepadSource GvrGamepadDataFetcher::Factory::source() {
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.h ('k') | device/vr/test/fake_vr_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698