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

Side by Side Diff: remoting/host/dns_blackhole_checker.cc

Issue 11053024: Remove ChromotingHostContext from DnsBlackholeChecker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/dns_blackhole_checker.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "remoting/host/dns_blackhole_checker.h" 5 #include "remoting/host/dns_blackhole_checker.h"
6 6
7 #include "googleurl/src/gurl.h" 7 #include "googleurl/src/gurl.h"
8 #include "net/url_request/url_fetcher.h" 8 #include "net/url_request/url_fetcher.h"
9 #include "remoting/host/chromoting_host_context.h" 9 #include "net/url_request/url_request_context_getter.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 // Default prefix added to the base talkgadget URL. 13 // Default prefix added to the base talkgadget URL.
14 const char kDefaultHostTalkGadgetPrefix[] = "chromoting-host"; 14 const char kDefaultHostTalkGadgetPrefix[] = "chromoting-host";
15 15
16 // The base talkgadget URL. 16 // The base talkgadget URL.
17 const char kTalkGadgetUrl[] = ".talkgadget.google.com/talkgadget/" 17 const char kTalkGadgetUrl[] = ".talkgadget.google.com/talkgadget/"
18 "oauth/chrome-remote-desktop-host"; 18 "oauth/chrome-remote-desktop-host";
19 19
20 DnsBlackholeChecker::DnsBlackholeChecker( 20 DnsBlackholeChecker::DnsBlackholeChecker(
21 ChromotingHostContext* context, 21 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
22 std::string talkgadget_prefix) 22 std::string talkgadget_prefix)
23 : context_(context), 23 : url_request_context_getter_(url_request_context_getter),
24 talkgadget_prefix_(talkgadget_prefix) { 24 talkgadget_prefix_(talkgadget_prefix) {
25 } 25 }
26 26
27 DnsBlackholeChecker::~DnsBlackholeChecker() { 27 DnsBlackholeChecker::~DnsBlackholeChecker() {
28 } 28 }
29 29
30 // This is called in response to the TalkGadget http request initiated from 30 // This is called in response to the TalkGadget http request initiated from
31 // CheckStatus(). 31 // CheckStatus().
32 void DnsBlackholeChecker::OnURLFetchComplete(const net::URLFetcher* source) { 32 void DnsBlackholeChecker::OnURLFetchComplete(const net::URLFetcher* source) {
33 int response = source->GetResponseCode(); 33 int response = source->GetResponseCode();
(...skipping 18 matching lines...) Expand all
52 std::string talkgadget_url("https://"); 52 std::string talkgadget_url("https://");
53 if (talkgadget_prefix_.empty()) { 53 if (talkgadget_prefix_.empty()) {
54 talkgadget_url += kDefaultHostTalkGadgetPrefix; 54 talkgadget_url += kDefaultHostTalkGadgetPrefix;
55 } else { 55 } else {
56 talkgadget_url += talkgadget_prefix_; 56 talkgadget_url += talkgadget_prefix_;
57 } 57 }
58 talkgadget_url += kTalkGadgetUrl; 58 talkgadget_url += kTalkGadgetUrl;
59 LOG(INFO) << "Verifying connection to " << talkgadget_url; 59 LOG(INFO) << "Verifying connection to " << talkgadget_url;
60 url_fetcher_.reset(net::URLFetcher::Create(GURL(talkgadget_url), 60 url_fetcher_.reset(net::URLFetcher::Create(GURL(talkgadget_url),
61 net::URLFetcher::GET, this)); 61 net::URLFetcher::GET, this));
62 url_fetcher_->SetRequestContext(context_->url_request_context_getter()); 62 url_fetcher_->SetRequestContext(url_request_context_getter_.get());
63 url_fetcher_->Start(); 63 url_fetcher_->Start();
64 } else { 64 } else {
65 LOG(INFO) << "Pending connection check"; 65 LOG(INFO) << "Pending connection check";
66 } 66 }
67 } 67 }
68 68
69 } // namespace remoting 69 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/dns_blackhole_checker.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698