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

Side by Side Diff: content/browser/device_sensors/sensor_manager_android.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/device_sensors/sensor_manager_android.h" 5 #include "content/browser/device_sensors/sensor_manager_android.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 SensorManagerAndroid::~SensorManagerAndroid() { 55 SensorManagerAndroid::~SensorManagerAndroid() {
56 } 56 }
57 57
58 bool SensorManagerAndroid::Register(JNIEnv* env) { 58 bool SensorManagerAndroid::Register(JNIEnv* env) {
59 return RegisterNativesImpl(env); 59 return RegisterNativesImpl(env);
60 } 60 }
61 61
62 SensorManagerAndroid* SensorManagerAndroid::GetInstance() { 62 SensorManagerAndroid* SensorManagerAndroid::GetInstance() {
63 return Singleton<SensorManagerAndroid, 63 return base::Singleton<
64 LeakySingletonTraits<SensorManagerAndroid> >::get(); 64 SensorManagerAndroid,
65 base::LeakySingletonTraits<SensorManagerAndroid>>::get();
65 } 66 }
66 67
67 void SensorManagerAndroid::GotOrientation( 68 void SensorManagerAndroid::GotOrientation(
68 JNIEnv*, jobject, double alpha, double beta, double gamma) { 69 JNIEnv*, jobject, double alpha, double beta, double gamma) {
69 base::AutoLock autolock(orientation_buffer_lock_); 70 base::AutoLock autolock(orientation_buffer_lock_);
70 71
71 if (!device_orientation_buffer_) 72 if (!device_orientation_buffer_)
72 return; 73 return;
73 74
74 device_orientation_buffer_->seqlock.WriteBegin(); 75 device_orientation_buffer_->seqlock.WriteBegin();
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 445 }
445 } 446 }
446 } 447 }
447 448
448 void SensorManagerAndroid::Shutdown() { 449 void SensorManagerAndroid::Shutdown() {
449 DCHECK_CURRENTLY_ON(BrowserThread::UI); 450 DCHECK_CURRENTLY_ON(BrowserThread::UI);
450 is_shutdown_ = true; 451 is_shutdown_ = true;
451 } 452 }
452 453
453 } // namespace content 454 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/device_sensors/sensor_manager_android.h ('k') | content/browser/devtools/devtools_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698