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

Side by Side Diff: content/browser/vr/vr_service_consumer.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored singleton lifetime Created 5 years, 8 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/vr/vr_service_consumer.h"
6
7 #include "content/browser/vr/vr_service.h"
8
9 namespace content {
10
11 VRServiceConsumer::VRServiceConsumer() :
12 service_(NULL),
no sievers 2015/03/27 01:18:27 |service_| is unused
13 registered_with_service_(false) {
14 }
15
16 VRServiceConsumer::~VRServiceConsumer() {
17 if (registered_with_service_) {
18 VRService::RemoveConsumer(this);
19 }
20 }
21
22 VRService* VRServiceConsumer::GetServiceInstance() {
23 if (!registered_with_service_) {
24 VRService::AddConsumer(this);
25 registered_with_service_ = true;
26 }
27 return VRService::GetInstance();
28 }
29
30 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698