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

Side by Side Diff: content/browser/android/download_controller_android_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/android/download_controller_android_impl.h" 5 #include "content/browser/android/download_controller_android_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 //static 141 //static
142 void DownloadControllerAndroid::SetDownloadControllerAndroid( 142 void DownloadControllerAndroid::SetDownloadControllerAndroid(
143 DownloadControllerAndroid* download_controller) { 143 DownloadControllerAndroid* download_controller) {
144 base::AutoLock lock(g_download_controller_lock_.Get()); 144 base::AutoLock lock(g_download_controller_lock_.Get());
145 DownloadControllerAndroid::download_controller_ = download_controller; 145 DownloadControllerAndroid::download_controller_ = download_controller;
146 } 146 }
147 147
148 // static 148 // static
149 DownloadControllerAndroidImpl* DownloadControllerAndroidImpl::GetInstance() { 149 DownloadControllerAndroidImpl* DownloadControllerAndroidImpl::GetInstance() {
150 return Singleton<DownloadControllerAndroidImpl>::get(); 150 return base::Singleton<DownloadControllerAndroidImpl>::get();
151 } 151 }
152 152
153 DownloadControllerAndroidImpl::DownloadControllerAndroidImpl() 153 DownloadControllerAndroidImpl::DownloadControllerAndroidImpl()
154 : java_object_(NULL) { 154 : java_object_(NULL) {
155 } 155 }
156 156
157 DownloadControllerAndroidImpl::~DownloadControllerAndroidImpl() { 157 DownloadControllerAndroidImpl::~DownloadControllerAndroidImpl() {
158 if (java_object_) { 158 if (java_object_) {
159 JNIEnv* env = base::android::AttachCurrentThread(); 159 JNIEnv* env = base::android::AttachCurrentThread();
160 env->DeleteWeakGlobalRef(java_object_->obj); 160 env->DeleteWeakGlobalRef(java_object_->obj);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 577 }
578 578
579 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 579 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
580 if (info) 580 if (info)
581 has_user_gesture = info->HasUserGesture(); 581 has_user_gesture = info->HasUserGesture();
582 } 582 }
583 583
584 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {} 584 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {}
585 585
586 } // namespace content 586 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698