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

Side by Side Diff: components/offline_pages/background/request_coordinator.cc

Issue 2233493003: [Offline Pages] Remove expired requests from the queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing build. Created 4 years, 4 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 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 policy_(std::move(policy)), 63 policy_(std::move(policy)),
64 factory_(std::move(factory)), 64 factory_(std::move(factory)),
65 queue_(std::move(queue)), 65 queue_(std::move(queue)),
66 scheduler_(std::move(scheduler)), 66 scheduler_(std::move(scheduler)),
67 active_request_(nullptr), 67 active_request_(nullptr),
68 last_offlining_status_(Offliner::RequestStatus::UNKNOWN), 68 last_offlining_status_(Offliner::RequestStatus::UNKNOWN),
69 offliner_timeout_(base::TimeDelta::FromSeconds( 69 offliner_timeout_(base::TimeDelta::FromSeconds(
70 policy_->GetSinglePageTimeLimitInSeconds())), 70 policy_->GetSinglePageTimeLimitInSeconds())),
71 weak_ptr_factory_(this) { 71 weak_ptr_factory_(this) {
72 DCHECK(policy_ != nullptr); 72 DCHECK(policy_ != nullptr);
73 picker_.reset(new RequestPicker(queue_.get(), policy_.get())); 73 picker_.reset(new RequestPicker(queue_.get(), policy_.get(), this));
74 } 74 }
75 75
76 RequestCoordinator::~RequestCoordinator() {} 76 RequestCoordinator::~RequestCoordinator() {}
77 77
78 bool RequestCoordinator::SavePageLater( 78 bool RequestCoordinator::SavePageLater(
79 const GURL& url, const ClientId& client_id, bool user_requested) { 79 const GURL& url, const ClientId& client_id, bool user_requested) {
80 DVLOG(2) << "URL is " << url << " " << __func__; 80 DVLOG(2) << "URL is " << url << " " << __func__;
81 81
82 if (!OfflinePageModel::CanSaveURL(url)) { 82 if (!OfflinePageModel::CanSaveURL(url)) {
83 DVLOG(1) << "Not able to save page for requested url: " << url; 83 DVLOG(1) << "Not able to save page for requested url: " << url;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 FOR_EACH_OBSERVER(Observer, observers_, OnChanged(request)); 405 FOR_EACH_OBSERVER(Observer, observers_, OnChanged(request));
406 } 406 }
407 407
408 void RequestCoordinator::GetOffliner() { 408 void RequestCoordinator::GetOffliner() {
409 if (!offliner_) { 409 if (!offliner_) {
410 offliner_ = factory_->GetOffliner(policy_.get()); 410 offliner_ = factory_->GetOffliner(policy_.get());
411 } 411 }
412 } 412 }
413 413
414 } // namespace offline_pages 414 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_coordinator.h ('k') | components/offline_pages/background/request_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698