| OLD | NEW |
| 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 "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "net/traffic_annotation/network_traffic_annotation.h" |
| 8 #include "net/url_request/url_fetcher.h" | 9 #include "net/url_request/url_fetcher.h" |
| 9 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
| 10 #include "remoting/base/logging.h" | 11 #include "remoting/base/logging.h" |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace remoting { | 14 namespace remoting { |
| 14 | 15 |
| 15 // Default prefix added to the base talkgadget URL. | 16 // Default prefix added to the base talkgadget URL. |
| 16 const char kDefaultHostTalkGadgetPrefix[] = "chromoting-host"; | 17 const char kDefaultHostTalkGadgetPrefix[] = "chromoting-host"; |
| 17 | 18 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 DCHECK(callback_.is_null()); | 52 DCHECK(callback_.is_null()); |
| 52 callback_ = callback; | 53 callback_ = callback; |
| 53 std::string talkgadget_url("https://"); | 54 std::string talkgadget_url("https://"); |
| 54 if (talkgadget_prefix_.empty()) { | 55 if (talkgadget_prefix_.empty()) { |
| 55 talkgadget_url += kDefaultHostTalkGadgetPrefix; | 56 talkgadget_url += kDefaultHostTalkGadgetPrefix; |
| 56 } else { | 57 } else { |
| 57 talkgadget_url += talkgadget_prefix_; | 58 talkgadget_url += talkgadget_prefix_; |
| 58 } | 59 } |
| 59 talkgadget_url += kTalkGadgetUrl; | 60 talkgadget_url += kTalkGadgetUrl; |
| 60 HOST_LOG << "Verifying connection to " << talkgadget_url; | 61 HOST_LOG << "Verifying connection to " << talkgadget_url; |
| 61 url_fetcher_ = net::URLFetcher::Create(GURL(talkgadget_url), | 62 net::NetworkTrafficAnnotationTag traffic_annotation = |
| 62 net::URLFetcher::GET, this); | 63 net::DefineNetworkTrafficAnnotation("...", R"( |
| 64 semantics { |
| 65 sender: "..." |
| 66 description: "..." |
| 67 trigger: "..." |
| 68 data: "..." |
| 69 destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER |
| 70 } |
| 71 policy { |
| 72 cookies_allowed: false/true |
| 73 cookies_store: "..." |
| 74 setting: "..." |
| 75 policy { |
| 76 [POLICY_NAME] { |
| 77 policy_options {mode: MANDATORY/RECOMMENDED/UNSET} |
| 78 [POLICY_NAME]: ... //(value to disable it) |
| 79 } |
| 80 } |
| 81 policy_exception_justification: "..." |
| 82 })"); |
| 83 url_fetcher_ = net::URLFetcher::Create( |
| 84 GURL(talkgadget_url), net::URLFetcher::GET, this, traffic_annotation); |
| 63 url_fetcher_->SetRequestContext(url_request_context_getter_.get()); | 85 url_fetcher_->SetRequestContext(url_request_context_getter_.get()); |
| 64 url_fetcher_->Start(); | 86 url_fetcher_->Start(); |
| 65 } else { | 87 } else { |
| 66 HOST_LOG << "Pending connection check"; | 88 HOST_LOG << "Pending connection check"; |
| 67 } | 89 } |
| 68 } | 90 } |
| 69 | 91 |
| 70 } // namespace remoting | 92 } // namespace remoting |
| OLD | NEW |