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

Side by Side Diff: chrome/browser/android/download/download_manager_service.cc

Issue 2853363002: Rename the DownloadService to DownloadCoreService (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/app_controller_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/android/download/download_manager_service.h" 5 #include "chrome/browser/android/download/download_manager_service.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "chrome/browser/android/chrome_feature_list.h" 13 #include "chrome/browser/android/chrome_feature_list.h"
14 #include "chrome/browser/android/download/download_controller.h" 14 #include "chrome/browser/android/download/download_controller.h"
15 #include "chrome/browser/download/download_service.h" 15 #include "chrome/browser/download/download_core_service.h"
David Trainor- moved to gerrit 2017/05/02 18:36:25 It's interesting to see how it decides which _ is
16 #include "chrome/browser/download/download_service_factory.h" 16 #include "chrome/browser/download/download_core_service_factory.h"
17 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
19 #include "components/mime_util/mime_util.h" 19 #include "components/mime_util/mime_util.h"
20 #include "components/variations/variations_associated_data.h" 20 #include "components/variations/variations_associated_data.h"
21 #include "content/public/browser/browser_context.h" 21 #include "content/public/browser/browser_context.h"
22 #include "content/public/browser/download_item.h" 22 #include "content/public/browser/download_item.h"
23 #include "jni/DownloadInfo_jni.h" 23 #include "jni/DownloadInfo_jni.h"
24 #include "jni/DownloadItem_jni.h" 24 #include "jni/DownloadItem_jni.h"
25 #include "jni/DownloadManagerService_jni.h" 25 #include "jni/DownloadManagerService_jni.h"
26 26
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 ConvertUTF8ToJavaString(env, item->GetReferrerUrl().spec()), 123 ConvertUTF8ToJavaString(env, item->GetReferrerUrl().spec()),
124 time_remaining_known ? time_delta.InMilliseconds() 124 time_remaining_known ? time_delta.InMilliseconds()
125 : kUnknownRemainingTime, 125 : kUnknownRemainingTime,
126 item->GetLastAccessTime().ToJavaTime()); 126 item->GetLastAccessTime().ToJavaTime());
127 } 127 }
128 128
129 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { 129 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) {
130 Profile* profile = ProfileManager::GetActiveUserProfile(); 130 Profile* profile = ProfileManager::GetActiveUserProfile();
131 DownloadManagerService* service = DownloadManagerService::GetInstance(); 131 DownloadManagerService* service = DownloadManagerService::GetInstance();
132 service->Init(env, jobj); 132 service->Init(env, jobj);
133 DownloadService* download_service = 133 DownloadCoreService* download_core_service =
134 DownloadServiceFactory::GetForBrowserContext(profile); 134 DownloadCoreServiceFactory::GetForBrowserContext(profile);
135 DownloadHistory* history = download_service->GetDownloadHistory(); 135 DownloadHistory* history = download_core_service->GetDownloadHistory();
136 if (history) 136 if (history)
137 history->AddObserver(service); 137 history->AddObserver(service);
138 return reinterpret_cast<intptr_t>(service); 138 return reinterpret_cast<intptr_t>(service);
139 } 139 }
140 140
141 DownloadManagerService::DownloadManagerService() 141 DownloadManagerService::DownloadManagerService()
142 : is_history_query_complete_(false), 142 : is_history_query_complete_(false),
143 pending_get_downloads_actions_(NONE) { 143 pending_get_downloads_actions_(NONE) {
144 } 144 }
145 145
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 chrome::android::kDownloadAutoResumptionThrottling, 477 chrome::android::kDownloadAutoResumptionThrottling,
478 kAutoResumptionLimitVariation); 478 kAutoResumptionLimitVariation);
479 int auto_resumption_limit; 479 int auto_resumption_limit;
480 if (!variation.empty() && 480 if (!variation.empty() &&
481 base::StringToInt(variation, &auto_resumption_limit)) { 481 base::StringToInt(variation, &auto_resumption_limit)) {
482 return auto_resumption_limit; 482 return auto_resumption_limit;
483 } 483 }
484 484
485 return kDefaultAutoResumptionLimit; 485 return kDefaultAutoResumptionLimit;
486 } 486 }
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/app_controller_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698