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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_code_fetcher.h

Issue 2547073002: Fix race issue in ArcAuthService. (Closed)
Patch Set: Address comments Created 4 years 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
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/arc_auth_code_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_code_fetcher.h
diff --git a/chrome/browser/chromeos/arc/arc_auth_code_fetcher.h b/chrome/browser/chromeos/arc/arc_auth_code_fetcher.h
deleted file mode 100644
index 19a2c18fdb3a9093d2d7e2ed3c121702e7ca3036..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/arc/arc_auth_code_fetcher.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2016 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
-#define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
-
-#include <memory>
-#include <string>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "chrome/browser/chromeos/arc/arc_auth_context.h"
-#include "google_apis/gaia/oauth2_token_service.h"
-#include "net/url_request/url_fetcher_delegate.h"
-
-class Profile;
-
-namespace net {
-class URLFetcher;
-class URLRequestContextGetter;
-}
-
-namespace arc {
-
-// The instance is not reusable, so for each Fetch(), the instance must be
-// re-created. Deleting the instance cancels inflight operation.
-class ArcAuthCodeFetcher : public OAuth2TokenService::Consumer,
- public net::URLFetcherDelegate {
- public:
- ArcAuthCodeFetcher(Profile* profile, ArcAuthContext* context);
- ~ArcAuthCodeFetcher() override;
-
- // Starts to fetch the token. On success fetched |auth_token| is passed.
- // On error, auth_token is empty.
- using FetchCallback = base::Callback<void(const std::string& auth_token)>;
- void Fetch(const FetchCallback& callback);
-
- // OAuth2TokenService::Consumer:
- void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) override;
- void OnGetTokenFailure(const OAuth2TokenService::Request* request,
- const GoogleServiceAuthError& error) override;
-
- // net::URLFetcherDelegate:
- void OnURLFetchComplete(const net::URLFetcher* source) override;
-
- private:
- void ResetFetchers();
- void OnPrepared(net::URLRequestContextGetter* request_context_getter);
-
- // Unowned pointers.
- Profile* const profile_;
- ArcAuthContext* const context_;
- net::URLRequestContextGetter* request_context_getter_ = nullptr;
-
- FetchCallback callback_;
-
- std::unique_ptr<OAuth2TokenService::Request> login_token_request_;
- std::unique_ptr<net::URLFetcher> auth_code_fetcher_;
-
- base::WeakPtrFactory<ArcAuthCodeFetcher> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ArcAuthCodeFetcher);
-};
-
-} // namespace arc
-
-#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/arc_auth_code_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698