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

Side by Side Diff: chrome/browser/local_discovery/privet_http.h

Issue 1435303002: Temporarily add PrivetHttpClient::GetHost method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@context1
Patch Set: Created 5 years, 1 month 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 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Creates a URL fetcher for PrivetV1. 57 // Creates a URL fetcher for PrivetV1.
58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher( 58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher(
59 const GURL& url, 59 const GURL& url,
60 net::URLFetcher::RequestType request_type, 60 net::URLFetcher::RequestType request_type,
61 PrivetURLFetcher::Delegate* delegate) = 0; 61 PrivetURLFetcher::Delegate* delegate) = 0;
62 62
63 virtual void RefreshPrivetToken( 63 virtual void RefreshPrivetToken(
64 const PrivetURLFetcher::TokenCallback& token_callback) = 0; 64 const PrivetURLFetcher::TokenCallback& token_callback) = 0;
65 65
66 // TODO(vitalybuka): Remove all below as part of crbug.com/551631
67 // PrivetV3Session should not need to use PrivetHTTPClient.
66 // After this call only HTTPS will be used. Only requests to the server with 68 // After this call only HTTPS will be used. Only requests to the server with
67 // matching certificate will be allowed. 69 // matching certificate will be allowed.
68 // Privet v3 devices MUST support HTTPS. Before communicating over HTTPS, 70 // Privet v3 devices MUST support HTTPS. Before communicating over HTTPS,
69 // Privet v3 pairing generates a shared secret using SPAKE2 over an 71 // Privet v3 pairing generates a shared secret using SPAKE2 over an
70 // unauthenticated channel. This shared secret is used to then authenticate 72 // unauthenticated channel. This shared secret is used to then authenticate
71 // the fingerprint of a certificate, which is self-signed. The client then 73 // the fingerprint of a certificate, which is self-signed. The client then
72 // validates that the HTTPS peer is sending a certificate matching that 74 // validates that the HTTPS peer is sending a certificate matching that
73 // fingerprint. 75 // fingerprint.
74 // For more information on this protocol: 76 // For more information on this protocol:
75 // https://developers.google.com/cloud-devices/v1/reference/local-api/pairing_ start 77 // https://developers.google.com/cloud-devices/v1/reference/local-api/pairing_ start
76 virtual void SwitchToHttps( 78 virtual void SwitchToHttps(
77 uint16_t port, 79 uint16_t port,
78 const net::SHA256HashValue& certificate_fingerprint) = 0; 80 const net::SHA256HashValue& certificate_fingerprint) = 0;
79 81
80 virtual bool IsInHttpsMode() const = 0; 82 virtual bool IsInHttpsMode() const = 0;
83
84 virtual std::string GetHost() const = 0;
81 }; 85 };
82 86
83 class PrivetDataReadOperation { 87 class PrivetDataReadOperation {
84 public: 88 public:
85 enum ResponseType { 89 enum ResponseType {
86 RESPONSE_TYPE_ERROR, 90 RESPONSE_TYPE_ERROR,
87 RESPONSE_TYPE_STRING, 91 RESPONSE_TYPE_STRING,
88 RESPONSE_TYPE_FILE 92 RESPONSE_TYPE_FILE
89 }; 93 };
90 94
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( 225 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation(
222 const PrivetJSONOperation::ResultCallback& callback) = 0; 226 const PrivetJSONOperation::ResultCallback& callback) = 0;
223 227
224 // Creates operation to submit print job to local printer. 228 // Creates operation to submit print job to local printer.
225 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( 229 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation(
226 PrivetLocalPrintOperation::Delegate* delegate) = 0; 230 PrivetLocalPrintOperation::Delegate* delegate) = 0;
227 }; 231 };
228 232
229 } // namespace local_discovery 233 } // namespace local_discovery
230 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 234 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698