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

Side by Side Diff: chrome/browser/extensions/blacklist_state_fetcher.cc

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (Closed)
Patch Set: Created 3 years, 8 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/extensions/blacklist_state_fetcher.h" 5 #include "chrome/browser/extensions/blacklist_state_fetcher.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 10 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
(...skipping 20 matching lines...) Expand all
31 31
32 void BlacklistStateFetcher::Request(const std::string& id, 32 void BlacklistStateFetcher::Request(const std::string& id,
33 const RequestCallback& callback) { 33 const RequestCallback& callback) {
34 DCHECK_CURRENTLY_ON(BrowserThread::UI); 34 DCHECK_CURRENTLY_ON(BrowserThread::UI);
35 if (!safe_browsing_config_) { 35 if (!safe_browsing_config_) {
36 if (g_browser_process && g_browser_process->safe_browsing_service()) { 36 if (g_browser_process && g_browser_process->safe_browsing_service()) {
37 SetSafeBrowsingConfig( 37 SetSafeBrowsingConfig(
38 g_browser_process->safe_browsing_service()->GetProtocolConfig()); 38 g_browser_process->safe_browsing_service()->GetProtocolConfig());
39 } else { 39 } else {
40 base::ThreadTaskRunnerHandle::Get()->PostTask( 40 base::ThreadTaskRunnerHandle::Get()->PostTask(
41 FROM_HERE, base::Bind(callback, BLACKLISTED_UNKNOWN)); 41 FROM_HERE, base::BindOnce(callback, BLACKLISTED_UNKNOWN));
42 return; 42 return;
43 } 43 }
44 } 44 }
45 45
46 bool request_already_sent = base::ContainsKey(callbacks_, id); 46 bool request_already_sent = base::ContainsKey(callbacks_, id);
47 callbacks_.insert(std::make_pair(id, callback)); 47 callbacks_.insert(std::make_pair(id, callback));
48 if (request_already_sent) 48 if (request_already_sent)
49 return; 49 return;
50 50
51 if (!url_request_context_getter_ && g_browser_process && 51 if (!url_request_context_getter_ && g_browser_process &&
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 for (CallbackMultiMap::const_iterator callback_it = range.first; 175 for (CallbackMultiMap::const_iterator callback_it = range.first;
176 callback_it != range.second; 176 callback_it != range.second;
177 ++callback_it) { 177 ++callback_it) {
178 callback_it->second.Run(state); 178 callback_it->second.Run(state);
179 } 179 }
180 180
181 callbacks_.erase(range.first, range.second); 181 callbacks_.erase(range.first, range.second);
182 } 182 }
183 183
184 } // namespace extensions 184 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/blacklist.cc ('k') | chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698