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

Unified Diff: remoting/client/token_fetcher_proxy.h

Issue 311983003: Third Party Authentication for Android Part I - TokenFetcherProxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Consolidate PepperTokenFetcher and JniTokenFetcher Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: remoting/client/token_fetcher_proxy.h
diff --git a/remoting/client/plugin/pepper_token_fetcher.h b/remoting/client/token_fetcher_proxy.h
similarity index 50%
rename from remoting/client/plugin/pepper_token_fetcher.h
rename to remoting/client/token_fetcher_proxy.h
index b914f51c2b52e816570d254fd1c1a6bd805e13f8..ddfa67f2f82e3b43f2490563e6e615b2eafe0a60 100644
--- a/remoting/client/plugin/pepper_token_fetcher.h
+++ b/remoting/client/token_fetcher_proxy.h
@@ -1,9 +1,9 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_
-#define REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_
+#ifndef REMOTING_PROTOCOL_TOKEN_FETCHER_PROXY_H_
Lambros 2014/06/04 22:20:19 nit: s/PROTOCOL/CLIENT (same at bottom of file)
kelvinp 2014/06/05 23:53:14 Done.
+#define REMOTING_PROTOCOL_TOKEN_FETCHER_PROXY_H_
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
@@ -11,14 +11,17 @@
namespace remoting {
-class ChromotingInstance;
-
-class PepperTokenFetcher
+class TokenFetcherProxy
: public protocol::ThirdPartyClientAuthenticator::TokenFetcher {
public:
- PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin,
- const std::string& host_public_key);
- virtual ~PepperTokenFetcher();
+ typedef base::Callback<void(
+ const GURL& token_url,
+ const std::string& scope,
+ base::WeakPtr<TokenFetcherProxy>)> TokenFetcherCallback;
+
+ TokenFetcherProxy(TokenFetcherCallback token_fetcher_impl,
Sergey Ulanov 2014/06/05 22:04:01 nit: const reference
kelvinp 2014/06/05 23:53:14 Done.
+ const std::string& host_public_key);
Sergey Ulanov 2014/06/05 22:06:18 please mark constructor as explicit if you remove
kelvinp 2014/06/05 23:53:14 Turns out |host_public_key| is needed. See commen
+ virtual ~TokenFetcherProxy();
// protocol::TokenClientAuthenticator::TokenFetcher interface.
virtual void FetchThirdPartyToken(
@@ -26,19 +29,19 @@ class PepperTokenFetcher
const std::string& scope,
const TokenFetchedCallback& token_fetched_callback) OVERRIDE;
- // Called by ChromotingInstance when the webapp finishes fetching the token.
+ // Called by the token fetching implementation when the token is fetched.
void OnTokenFetched(const std::string& token,
const std::string& shared_secret);
private:
- base::WeakPtr<ChromotingInstance> plugin_;
std::string host_public_key_;
Sergey Ulanov 2014/06/05 22:04:01 This is not used anywhere. Can it be removed (and
kelvinp 2014/06/05 23:53:14 Good catch. This should be used when calling to t
TokenFetchedCallback token_fetched_callback_;
- base::WeakPtrFactory<PepperTokenFetcher> weak_factory_;
+ TokenFetcherCallback token_fetcher_impl_;
Sergey Ulanov 2014/06/05 22:04:01 nit: move this to top of the list, where plugin_ u
kelvinp 2014/06/05 23:53:14 Done.
+ base::WeakPtrFactory<TokenFetcherProxy> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(PepperTokenFetcher);
+ DISALLOW_COPY_AND_ASSIGN(TokenFetcherProxy);
};
} // namespace remoting
-#endif // REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_
+#endif // REMOTING_PROTOCOL_TOKEN_FETCHER_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698