| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/offline_pages/evaluation/offline_page_evaluatio
n_bridge.h" | 5 #include "chrome/browser/android/offline_pages/evaluation/offline_page_evaluatio
n_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/callback_android.h" | 7 #include "base/android/callback_android.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 profile->GetPath().Append(chrome::kOfflinePageRequestQueueDirname); | 139 profile->GetPath().Append(chrome::kOfflinePageRequestQueueDirname); |
| 140 | 140 |
| 141 std::unique_ptr<RequestQueueStoreSQL> queue_store( | 141 std::unique_ptr<RequestQueueStoreSQL> queue_store( |
| 142 new RequestQueueStoreSQL(background_task_runner, queue_store_path)); | 142 new RequestQueueStoreSQL(background_task_runner, queue_store_path)); |
| 143 std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(queue_store))); | 143 std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(queue_store))); |
| 144 std::unique_ptr<android::EvaluationTestScheduler> scheduler( | 144 std::unique_ptr<android::EvaluationTestScheduler> scheduler( |
| 145 new android::EvaluationTestScheduler()); | 145 new android::EvaluationTestScheduler()); |
| 146 net::NetworkQualityEstimator::NetworkQualityProvider* | 146 net::NetworkQualityEstimator::NetworkQualityProvider* |
| 147 network_quality_estimator = | 147 network_quality_estimator = |
| 148 UINetworkQualityEstimatorServiceFactory::GetForProfile(profile); | 148 UINetworkQualityEstimatorServiceFactory::GetForProfile(profile); |
| 149 // TODO(fgorski): Something needs to keep the handle to the Notification | |
| 150 // dispatcher. | |
| 151 std::unique_ptr<RequestCoordinator> request_coordinator = | 149 std::unique_ptr<RequestCoordinator> request_coordinator = |
| 152 base::MakeUnique<RequestCoordinator>( | 150 base::MakeUnique<RequestCoordinator>( |
| 153 std::move(policy), std::move(offliner), std::move(queue), | 151 std::move(policy), std::move(offliner), std::move(queue), |
| 154 std::move(scheduler), network_quality_estimator); | 152 std::move(scheduler), network_quality_estimator); |
| 155 request_coordinator->SetInternalStartProcessingCallbackForTest( | 153 request_coordinator->SetInternalStartProcessingCallbackForTest( |
| 156 base::Bind(&android::EvaluationTestScheduler::ImmediateScheduleCallback, | 154 base::Bind(&android::EvaluationTestScheduler::ImmediateScheduleCallback, |
| 157 base::Unretained(scheduler.get()))); | 155 base::Unretained(scheduler.get()))); |
| 158 | 156 |
| 159 DownloadNotifyingObserver::CreateAndStartObserving( | 157 DownloadNotifyingObserver::CreateAndStartObserving( |
| 160 request_coordinator.get(), | 158 request_coordinator.get(), |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 return; | 384 return; |
| 387 JNIEnv* env = base::android::AttachCurrentThread(); | 385 JNIEnv* env = base::android::AttachCurrentThread(); |
| 388 ScopedJavaLocalRef<jobject> obj = weak_java_ref_.get(env); | 386 ScopedJavaLocalRef<jobject> obj = weak_java_ref_.get(env); |
| 389 if (obj.is_null()) | 387 if (obj.is_null()) |
| 390 return; | 388 return; |
| 391 Java_OfflinePageEvaluationBridge_offlinePageModelLoaded(env, obj); | 389 Java_OfflinePageEvaluationBridge_offlinePageModelLoaded(env, obj); |
| 392 } | 390 } |
| 393 | 391 |
| 394 } // namespace android | 392 } // namespace android |
| 395 } // namespace offline_pages | 393 } // namespace offline_pages |
| OLD | NEW |