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

Unified Diff: services/authenticating_url_loader/authenticating_url_loader_factory_impl.h

Issue 1155283003: Change AuthenticatingURLLoader to be a URLLoaderInterceptor (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Response to review Created 5 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: services/authenticating_url_loader/authenticating_url_loader_factory_impl.h
diff --git a/services/authenticating_url_loader/authenticating_url_loader_factory_impl.h b/services/authenticating_url_loader/authenticating_url_loader_factory_impl.h
index dfa6c7ff351130f745fd040e521d103538279b90..b61ddac5ceac622908916439d063927f45cc3656 100644
--- a/services/authenticating_url_loader/authenticating_url_loader_factory_impl.h
+++ b/services/authenticating_url_loader/authenticating_url_loader_factory_impl.h
@@ -8,23 +8,18 @@
#include <memory>
#include "base/callback.h"
-#include "mojo/public/cpp/bindings/error_handler.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/services/authenticating_url_loader/public/interfaces/authenticating_url_loader_factory.mojom.h"
#include "mojo/services/authentication/public/interfaces/authentication.mojom.h"
-#include "mojo/services/network/public/interfaces/network_service.mojom.h"
#include "url/gurl.h"
namespace mojo {
class ApplicationImpl;
-class AuthenticatingURLLoaderImpl;
-
class AuthenticatingURLLoaderFactoryImpl
- : public AuthenticatingURLLoaderFactory,
- public ErrorHandler {
+ : public AuthenticatingURLLoaderFactory {
qsr 2015/06/05 10:54:55 This class doesn't seem to have any state in the e
blundell 2015/06/05 13:24:17 The application delegate maps the |cached_tokens|
public:
AuthenticatingURLLoaderFactoryImpl(
mojo::InterfaceRequest<AuthenticatingURLLoaderFactory> request,
@@ -32,46 +27,16 @@ class AuthenticatingURLLoaderFactoryImpl
std::map<GURL, std::string>* cached_tokens);
~AuthenticatingURLLoaderFactoryImpl() override;
- NetworkService* network_service() { return network_service_.get(); }
-
- // Returns a cached token for the given url (only considers the origin). Will
- // returns an empty string if no token is cached.
- std::string GetCachedToken(const GURL& url);
-
- void RetrieveToken(const GURL& url,
- const base::Callback<void(std::string)>& callback);
-
- void OnURLLoaderError(AuthenticatingURLLoaderImpl* url_loader);
-
private:
// AuthenticatingURLLoaderFactory:
- void CreateAuthenticatingURLLoader(
- mojo::InterfaceRequest<AuthenticatingURLLoader> loader_request) override;
- void SetAuthenticationService(
+ void CreateURLLoaderInterceptorFactory(
+ mojo::InterfaceRequest<URLLoaderInterceptorFactory> factory_request,
authentication::AuthenticationServicePtr authentication_service) override;
- // ErrorHandler:
- void OnConnectionError() override;
-
- void OnAccountSelected(const GURL& origin,
- mojo::String account,
- mojo::String error);
-
- void OnOAuth2TokenReceived(const GURL& origin,
- mojo::String token,
- mojo::String error);
-
- void ExecuteCallbacks(const GURL& origin, const std::string& result);
-
StrongBinding<AuthenticatingURLLoaderFactory> binding_;
ApplicationImpl* app_;
std::map<GURL, std::string>* cached_tokens_;
std::map<GURL, std::string> cached_accounts_;
qsr 2015/06/05 10:54:55 You do not seem to be using this anymore.
blundell 2015/06/05 13:24:17 Done.
- authentication::AuthenticationServicePtr authentication_service_;
- NetworkServicePtr network_service_;
- std::vector<std::unique_ptr<AuthenticatingURLLoaderImpl>> url_loaders_;
- std::map<GURL, std::vector<base::Callback<void(std::string)>>>
- pendings_retrieve_token_;
};
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698