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

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: git cl format 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 //static 139 //static
140 void DownloadControllerAndroid::SetDownloadControllerAndroid( 140 void DownloadControllerAndroid::SetDownloadControllerAndroid(
141 DownloadControllerAndroid* download_controller) { 141 DownloadControllerAndroid* download_controller) {
142 base::AutoLock lock(g_download_controller_lock_.Get()); 142 base::AutoLock lock(g_download_controller_lock_.Get());
143 DownloadControllerAndroid::download_controller_ = download_controller; 143 DownloadControllerAndroid::download_controller_ = download_controller;
144 } 144 }
145 145
146 // static 146 // static
147 DownloadControllerAndroidImpl* DownloadControllerAndroidImpl::GetInstance() { 147 DownloadControllerAndroidImpl* DownloadControllerAndroidImpl::GetInstance() {
148 return Singleton<DownloadControllerAndroidImpl>::get(); 148 return base::Singleton<DownloadControllerAndroidImpl>::get();
149 } 149 }
150 150
151 DownloadControllerAndroidImpl::DownloadControllerAndroidImpl() 151 DownloadControllerAndroidImpl::DownloadControllerAndroidImpl()
152 : java_object_(NULL) { 152 : java_object_(NULL) {
153 } 153 }
154 154
155 DownloadControllerAndroidImpl::~DownloadControllerAndroidImpl() { 155 DownloadControllerAndroidImpl::~DownloadControllerAndroidImpl() {
156 if (java_object_) { 156 if (java_object_) {
157 JNIEnv* env = base::android::AttachCurrentThread(); 157 JNIEnv* env = base::android::AttachCurrentThread();
158 env->DeleteWeakGlobalRef(java_object_->obj); 158 env->DeleteWeakGlobalRef(java_object_->obj);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 575 }
576 576
577 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 577 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
578 if (info) 578 if (info)
579 has_user_gesture = info->HasUserGesture(); 579 has_user_gesture = info->HasUserGesture();
580 } 580 }
581 581
582 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {} 582 DownloadControllerAndroidImpl::DownloadInfoAndroid::~DownloadInfoAndroid() {}
583 583
584 } // namespace content 584 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698