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

Unified Diff: chrome/browser/extensions/api/gcd_private/privet_v3_session.h

Issue 1441403005: Use shared shared URLRequestContextGetter for all gcd_private sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@context5
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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/gcd_private/privet_v3_session.h
diff --git a/chrome/browser/extensions/api/gcd_private/privet_v3_session.h b/chrome/browser/extensions/api/gcd_private/privet_v3_session.h
index eef8871ce6a526e5f7b09773db003d16162fb7bb..9455ca9939dfdabaf2cce1e474c7c81fc902611b 100644
--- a/chrome/browser/extensions/api/gcd_private/privet_v3_session.h
+++ b/chrome/browser/extensions/api/gcd_private/privet_v3_session.h
@@ -32,6 +32,8 @@ class PrivetURLFetcher;
namespace extensions {
+class PrivetV3ContextGetter;
+
// Manages secure communication between browser and local Privet device.
class PrivetV3Session {
private:
@@ -49,9 +51,8 @@ class PrivetV3Session {
const base::DictionaryValue& response)>
MessageCallback;
- PrivetV3Session(
- const scoped_refptr<net::URLRequestContextGetter>& context_getter,
- const net::HostPortPair& host_port);
+ PrivetV3Session(const scoped_refptr<PrivetV3ContextGetter>& context_getter,
+ const net::HostPortPair& host_port);
~PrivetV3Session();
// Initializes session. Queries /privet/info and returns supported pairing
@@ -83,6 +84,8 @@ class PrivetV3Session {
void OnPairingConfirmDone(const ResultCallback& callback,
Result result,
const base::DictionaryValue& response);
+ void OnPairedHostAddedToContext(const std::string& auth_code,
+ const ResultCallback& callback);
void OnAuthenticateDone(const ResultCallback& callback,
Result result,
const base::DictionaryValue& response);
@@ -102,6 +105,9 @@ class PrivetV3Session {
// Creates instances of PrivetURLFetcher.
scoped_ptr<local_discovery::PrivetHTTPClient> client_;
+ // Provides context for client_.
+ scoped_refptr<PrivetV3ContextGetter> context_getter_;
+
// Current authentication token.
std::string privet_auth_token_;

Powered by Google App Engine
This is Rietveld 408576698