Chromium Code Reviews| 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 "components/offline_pages/background/request_coordinator.h" | 5 #include "components/offline_pages/background/request_coordinator.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 return test_connection_type_; | 424 return test_connection_type_; |
| 425 | 425 |
| 426 return net::NetworkChangeNotifier::GetConnectionType(); | 426 return net::NetworkChangeNotifier::GetConnectionType(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void RequestCoordinator::AddRequestResultCallback( | 429 void RequestCoordinator::AddRequestResultCallback( |
| 430 RequestAvailability availability, | 430 RequestAvailability availability, |
| 431 AddRequestResult result, | 431 AddRequestResult result, |
| 432 const SavePageRequest& request) { | 432 const SavePageRequest& request) { |
| 433 NotifyAdded(request); | 433 NotifyAdded(request); |
| 434 NotifyChanged(request); | |
|
Pete Williamson
2016/11/28 18:12:03
Did you test this in the running app as opposed to
dougarnett
2016/11/28 18:36:54
Yeah, actually added this due to behavior seen in
fgorski
2016/11/28 20:53:49
Why both added and changed? I don't understand it.
dougarnett
2016/11/28 21:24:55
Dropped this and fixed request state handling in O
| |
| 434 // Inform the scheduler that we have an outstanding task. | 435 // Inform the scheduler that we have an outstanding task. |
| 435 scheduler_->Schedule(GetTriggerConditions(kUserRequest)); | 436 scheduler_->Schedule(GetTriggerConditions(kUserRequest)); |
| 436 | 437 |
| 437 if (availability == RequestAvailability::DISABLED_FOR_OFFLINER) { | 438 if (availability == RequestAvailability::DISABLED_FOR_OFFLINER) { |
| 438 // Mark attempt started (presuming it is disabled for background offliner | 439 // Mark attempt started (presuming it is disabled for background offliner |
| 439 // because foreground offlining is happening). | 440 // because foreground offlining is happening). |
| 440 queue_->MarkAttemptStarted( | 441 queue_->MarkAttemptStarted( |
| 441 request.request_id(), | 442 request.request_id(), |
| 442 base::Bind(&RequestCoordinator::MarkAttemptDone, | 443 base::Bind(&RequestCoordinator::MarkAttemptDone, |
| 443 weak_ptr_factory_.GetWeakPtr(), request.request_id(), | 444 weak_ptr_factory_.GetWeakPtr(), request.request_id(), |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 956 | 957 |
| 957 ClientPolicyController* RequestCoordinator::GetPolicyController() { | 958 ClientPolicyController* RequestCoordinator::GetPolicyController() { |
| 958 return policy_controller_.get(); | 959 return policy_controller_.get(); |
| 959 } | 960 } |
| 960 | 961 |
| 961 void RequestCoordinator::Shutdown() { | 962 void RequestCoordinator::Shutdown() { |
| 962 network_quality_estimator_ = nullptr; | 963 network_quality_estimator_ = nullptr; |
| 963 } | 964 } |
| 964 | 965 |
| 965 } // namespace offline_pages | 966 } // namespace offline_pages |
| OLD | NEW |