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

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

Issue 49253005: Fetch extension blacklist states from SafeBrowsing server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test_blacklist.h" 5 #include "chrome/browser/extensions/test_blacklist.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "chrome/browser/extensions/blacklist.h" 12 #include "chrome/browser/extensions/blacklist.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 TestBlacklist::TestBlacklist(Blacklist* blacklist) 16 TestBlacklist::TestBlacklist(Blacklist* blacklist)
17 : blacklist_(blacklist) { 17 : blacklist_(blacklist) {
18 } 18 }
19 19
20 namespace { 20 namespace {
21 21
22 void Assign(Blacklist::BlacklistState *out, Blacklist::BlacklistState in) { 22 void Assign(BlacklistState *out, BlacklistState in) {
23 *out = in; 23 *out = in;
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 Blacklist::BlacklistState TestBlacklist::GetBlacklistState( 28 BlacklistState TestBlacklist::GetBlacklistState(
29 const std::string& extension_id) { 29 const std::string& extension_id) {
30 Blacklist::BlacklistState blacklist_state; 30 BlacklistState blacklist_state;
31 blacklist_->IsBlacklisted(extension_id, 31 blacklist_->IsBlacklisted(extension_id,
32 base::Bind(&Assign, &blacklist_state)); 32 base::Bind(&Assign, &blacklist_state));
33 base::RunLoop().RunUntilIdle(); 33 base::RunLoop().RunUntilIdle();
34 return blacklist_state; 34 return blacklist_state;
35 } 35 }
36 36
37 } // namespace extensions 37 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_blacklist.h ('k') | chrome/browser/extensions/test_blacklist_state_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698