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

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

Issue 2180113003: Make sure the Async test cases availabel today generate correct ClientID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated per CR comments 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
« no previous file with comments | « chrome/browser/ui/webui/offline_internals_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 DCHECK(policy_ != nullptr); 55 DCHECK(policy_ != nullptr);
56 picker_.reset(new RequestPicker(queue_.get(), policy_.get())); 56 picker_.reset(new RequestPicker(queue_.get(), policy_.get()));
57 } 57 }
58 58
59 RequestCoordinator::~RequestCoordinator() {} 59 RequestCoordinator::~RequestCoordinator() {}
60 60
61 bool RequestCoordinator::SavePageLater( 61 bool RequestCoordinator::SavePageLater(
62 const GURL& url, const ClientId& client_id, bool was_user_requested) { 62 const GURL& url, const ClientId& client_id, bool was_user_requested) {
63 DVLOG(2) << "URL is " << url << " " << __FUNCTION__; 63 DVLOG(2) << "URL is " << url << " " << __FUNCTION__;
64 64
65 // TODO(petewil): We need a robust scheme for allocating new IDs. We may need 65 // TODO(petewil): We need a robust scheme for allocating new IDs.
66 // GUIDS for the downloads home design.
67 static int64_t id = 0; 66 static int64_t id = 0;
68 67
69 // Build a SavePageRequest. 68 // Build a SavePageRequest.
70 // TODO(petewil): Use something like base::Clock to help in testing. 69 // TODO(petewil): Use something like base::Clock to help in testing.
71 offline_pages::SavePageRequest request( 70 offline_pages::SavePageRequest request(
72 id++, url, client_id, base::Time::Now(), was_user_requested); 71 id++, url, client_id, base::Time::Now(), was_user_requested);
73 72
74 // Put the request on the request queue. 73 // Put the request on the request queue.
75 queue_->AddRequest(request, 74 queue_->AddRequest(request,
76 base::Bind(&RequestCoordinator::AddRequestResultCallback, 75 base::Bind(&RequestCoordinator::AddRequestResultCallback,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return trigger_conditions; 235 return trigger_conditions;
237 } 236 }
238 237
239 void RequestCoordinator::GetOffliner() { 238 void RequestCoordinator::GetOffliner() {
240 if (!offliner_) { 239 if (!offliner_) {
241 offliner_ = factory_->GetOffliner(policy_.get()); 240 offliner_ = factory_->GetOffliner(policy_.get());
242 } 241 }
243 } 242 }
244 243
245 } // namespace offline_pages 244 } // namespace offline_pages
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/offline_internals_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698