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

Side by Side Diff: components/download/internal/test/test_download_driver.cc

Issue 2895953004: Add initial Controller to DownloadService (Closed)
Patch Set: Rebased Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/download/internal/test/test_download_driver.h" 5 #include "components/download/internal/test/test_download_driver.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "components/download/public/download_params.h" 8 #include "components/download/public/download_params.h"
9 #include "net/http/http_response_headers.h" 9 #include "net/http/http_response_headers.h"
10 10
11 namespace download { 11 namespace download {
12 namespace test {
12 13
13 TestDownloadDriver::TestDownloadDriver() : is_ready_(false), client_(nullptr) {} 14 TestDownloadDriver::TestDownloadDriver() : is_ready_(false), client_(nullptr) {}
14 15
15 TestDownloadDriver::~TestDownloadDriver() = default; 16 TestDownloadDriver::~TestDownloadDriver() = default;
16 17
17 void TestDownloadDriver::MakeReady() { 18 void TestDownloadDriver::MakeReady() {
18 is_ready_ = true; 19 is_ready_ = true;
19 DCHECK(client_); 20 DCHECK(client_);
20 if (client_) 21 if (client_)
21 client_->OnDriverReady(is_ready_); 22 client_->OnDriverReady(is_ready_);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 75
75 void TestDownloadDriver::Resume(const std::string& guid) {} 76 void TestDownloadDriver::Resume(const std::string& guid) {}
76 77
77 base::Optional<DriverEntry> TestDownloadDriver::Find(const std::string& guid) { 78 base::Optional<DriverEntry> TestDownloadDriver::Find(const std::string& guid) {
78 auto it = entries_.find(guid); 79 auto it = entries_.find(guid);
79 if (it == entries_.end()) 80 if (it == entries_.end())
80 return base::nullopt; 81 return base::nullopt;
81 return it->second; 82 return it->second;
82 } 83 }
83 84
84 } // namespace downloads 85 } // namespace test
86 } // namespace download
OLDNEW
« no previous file with comments | « components/download/internal/test/test_download_driver.h ('k') | components/download/public/clients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698