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

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

Issue 1112573002: [chrome/browser/extensions] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed other nits Created 5 years, 7 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/test_blacklist_state_fetcher.h" 5 #include "chrome/browser/extensions/test_blacklist_state_fetcher.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/thread_task_runner_handle.h"
9 #include "net/url_request/url_request_test_util.h" 10 #include "net/url_request/url_request_test_util.h"
10 11
11 namespace extensions { 12 namespace extensions {
12 namespace { 13 namespace {
13 14
14 static const char kUrlPrefix[] = "https://prefix.com/foo"; 15 static const char kUrlPrefix[] = "https://prefix.com/foo";
15 static const char kBackupConnectUrlPrefix[] = "https://alt1-prefix.com/foo"; 16 static const char kBackupConnectUrlPrefix[] = "https://alt1-prefix.com/foo";
16 static const char kBackupHttpUrlPrefix[] = "https://alt2-prefix.com/foo"; 17 static const char kBackupHttpUrlPrefix[] = "https://alt2-prefix.com/foo";
17 static const char kBackupNetworkUrlPrefix[] = "https://alt3-prefix.com/foo"; 18 static const char kBackupNetworkUrlPrefix[] = "https://alt3-prefix.com/foo";
18 static const char kClient[] = "unittest"; 19 static const char kClient[] = "unittest";
(...skipping 10 matching lines...) Expand all
29 return config; 30 return config;
30 } 31 }
31 32
32 } // namespace 33 } // namespace
33 34
34 TestBlacklistStateFetcher::TestBlacklistStateFetcher( 35 TestBlacklistStateFetcher::TestBlacklistStateFetcher(
35 BlacklistStateFetcher* fetcher) : fetcher_(fetcher) { 36 BlacklistStateFetcher* fetcher) : fetcher_(fetcher) {
36 fetcher_->SetSafeBrowsingConfig(CreateSafeBrowsingProtocolConfig()); 37 fetcher_->SetSafeBrowsingConfig(CreateSafeBrowsingProtocolConfig());
37 scoped_refptr<net::TestURLRequestContextGetter> context = 38 scoped_refptr<net::TestURLRequestContextGetter> context =
38 new net::TestURLRequestContextGetter( 39 new net::TestURLRequestContextGetter(
39 base::MessageLoopProxy::current()); 40 base::ThreadTaskRunnerHandle::Get());
40 fetcher_->SetURLRequestContextForTest(context.get()); 41 fetcher_->SetURLRequestContextForTest(context.get());
41 } 42 }
42 43
43 TestBlacklistStateFetcher::~TestBlacklistStateFetcher() { 44 TestBlacklistStateFetcher::~TestBlacklistStateFetcher() {
44 } 45 }
45 46
46 void TestBlacklistStateFetcher::SetBlacklistVerdict( 47 void TestBlacklistStateFetcher::SetBlacklistVerdict(
47 const std::string& id, ClientCRXListInfoResponse_Verdict state) { 48 const std::string& id, ClientCRXListInfoResponse_Verdict state) {
48 verdicts_[id] = state; 49 verdicts_[id] = state;
49 } 50 }
(...skipping 22 matching lines...) Expand all
72 73
73 url_fetcher->set_status(net::URLRequestStatus()); 74 url_fetcher->set_status(net::URLRequestStatus());
74 url_fetcher->set_response_code(200); 75 url_fetcher->set_response_code(200);
75 url_fetcher->SetResponseString(response_str); 76 url_fetcher->SetResponseString(response_str);
76 url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); 77 url_fetcher->delegate()->OnURLFetchComplete(url_fetcher);
77 78
78 return true; 79 return true;
79 } 80 }
80 81
81 } // namespace extensions 82 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698