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

Side by Side Diff: components/feedback/system_logs/system_logs_fetcher.cc

Issue 2968613002: Move some of c/b/feedback/system_logs to //components/feedback (Closed)
Patch Set: fix include Created 3 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/feedback/system_logs/system_logs_fetcher.h" 5 #include "components/feedback/system_logs/system_logs_fetcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 13
14 using content::BrowserThread; 14 using content::BrowserThread;
15 15
16 namespace system_logs { 16 namespace system_logs {
17 17
18 namespace { 18 namespace {
19 19
20 // List of keys in the SystemLogsResponse map whose corresponding values will 20 // List of keys in the SystemLogsResponse map whose corresponding values will
21 // not be anonymized. 21 // not be anonymized.
22 constexpr const char* const kWhitelistedKeysOfUUIDs[] = { 22 constexpr const char* const kWhitelistedKeysOfUUIDs[] = {
23 "CHROMEOS_BOARD_APPID", 23 "CHROMEOS_BOARD_APPID", "CHROMEOS_CANARY_APPID", "CHROMEOS_RELEASE_APPID",
24 "CHROMEOS_CANARY_APPID",
25 "CHROMEOS_RELEASE_APPID",
26 "CLIENT_ID", 24 "CLIENT_ID",
27 }; 25 };
28 26
29 // Returns true if the given |key| is anonymizer-whitelisted and whose 27 // Returns true if the given |key| is anonymizer-whitelisted and whose
30 // corresponding value should not be anonymized. 28 // corresponding value should not be anonymized.
31 bool IsKeyWhitelisted(const std::string& key) { 29 bool IsKeyWhitelisted(const std::string& key) {
32 for (auto* const whitelisted_key : kWhitelistedKeysOfUUIDs) { 30 for (auto* const whitelisted_key : kWhitelistedKeysOfUUIDs) {
33 if (key == whitelisted_key) 31 if (key == whitelisted_key)
34 return true; 32 return true;
35 } 33 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 90
93 --num_pending_requests_; 91 --num_pending_requests_;
94 if (num_pending_requests_ > 0) 92 if (num_pending_requests_ > 0)
95 return; 93 return;
96 94
97 callback_.Run(std::move(response_)); 95 callback_.Run(std::move(response_));
98 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); 96 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this);
99 } 97 }
100 98
101 } // namespace system_logs 99 } // namespace system_logs
OLDNEW
« no previous file with comments | « components/feedback/system_logs/system_logs_fetcher.h ('k') | components/feedback/system_logs/system_logs_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698