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

Side by Side Diff: components/quirks/quirks_manager.cc

Issue 2365903004: Don't send Quirks Server requests for product_id = 0 (Closed)
Patch Set: Fix ash unit test Created 4 years, 2 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 | « ash/display/display_color_manager_chromeos_unittest.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/quirks/quirks_manager.h" 5 #include "components/quirks/quirks_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 for (const std::unique_ptr<QuirksClient>& client : clients_) 131 for (const std::unique_ptr<QuirksClient>& client : clients_)
132 client->StartDownload(); 132 client->StartDownload();
133 } 133 }
134 134
135 void QuirksManager::RequestIccProfilePath( 135 void QuirksManager::RequestIccProfilePath(
136 int64_t product_id, 136 int64_t product_id,
137 const RequestFinishedCallback& on_request_finished) { 137 const RequestFinishedCallback& on_request_finished) {
138 DCHECK(thread_checker_.CalledOnValidThread()); 138 DCHECK(thread_checker_.CalledOnValidThread());
139 139
140 if (!product_id) {
141 VLOG(1) << "Could not determine display information (product id = 0)";
142 on_request_finished.Run(base::FilePath(), false);
143 return;
144 }
145
140 std::string name = IdToFileName(product_id); 146 std::string name = IdToFileName(product_id);
141 base::PostTaskAndReplyWithResult( 147 base::PostTaskAndReplyWithResult(
142 blocking_pool_.get(), FROM_HERE, 148 blocking_pool_.get(), FROM_HERE,
143 base::Bind(&CheckForIccFile, 149 base::Bind(&CheckForIccFile,
144 delegate_->GetBuiltInDisplayProfileDirectory().Append(name), 150 delegate_->GetBuiltInDisplayProfileDirectory().Append(name),
145 delegate_->GetDownloadDisplayProfileDirectory().Append(name), 151 delegate_->GetDownloadDisplayProfileDirectory().Append(name),
146 QuirksEnabled()), 152 QuirksEnabled()),
147 base::Bind(&QuirksManager::OnIccFilePathRequestCompleted, 153 base::Bind(&QuirksManager::OnIccFilePathRequestCompleted,
148 weak_ptr_factory_.GetWeakPtr(), product_id, 154 weak_ptr_factory_.GetWeakPtr(), product_id,
149 on_request_finished)); 155 on_request_finished));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 224 }
219 225
220 void QuirksManager::SetLastServerCheck(int64_t product_id, 226 void QuirksManager::SetLastServerCheck(int64_t product_id,
221 const base::Time& last_check) { 227 const base::Time& last_check) {
222 DCHECK(thread_checker_.CalledOnValidThread()); 228 DCHECK(thread_checker_.CalledOnValidThread());
223 DictionaryPrefUpdate dict(local_state_, prefs::kQuirksClientLastServerCheck); 229 DictionaryPrefUpdate dict(local_state_, prefs::kQuirksClientLastServerCheck);
224 dict->SetDouble(IdToHexString(product_id), last_check.ToDoubleT()); 230 dict->SetDouble(IdToHexString(product_id), last_check.ToDoubleT());
225 } 231 }
226 232
227 } // namespace quirks 233 } // namespace quirks
OLDNEW
« no previous file with comments | « ash/display/display_color_manager_chromeos_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698