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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_context.h

Issue 2896513002: [Merge M59] arg: Implement retry logic for transient errors (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "google_apis/gaia/ubertoken_fetcher.h" 14 #include "google_apis/gaia/ubertoken_fetcher.h"
15 #include "net/base/backoff_entry.h"
15 16
16 class Profile; 17 class Profile;
17 class ProfileOAuth2TokenService; 18 class ProfileOAuth2TokenService;
18 19
19 namespace content { 20 namespace content {
20 class StoragePartition; 21 class StoragePartition;
21 } 22 }
22 23
23 namespace net { 24 namespace net {
24 class URLRequestContextGetter; 25 class URLRequestContextGetter;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 59
59 // GaiaAuthConsumer: 60 // GaiaAuthConsumer:
60 void OnMergeSessionSuccess(const std::string& data) override; 61 void OnMergeSessionSuccess(const std::string& data) override;
61 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; 62 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override;
62 63
63 private: 64 private:
64 void OnRefreshTokenTimeout(); 65 void OnRefreshTokenTimeout();
65 66
66 void StartFetchers(); 67 void StartFetchers();
67 void ResetFetchers(); 68 void ResetFetchers();
69 void OnFetcherError(const GoogleServiceAuthError& error);
68 70
69 // Unowned pointer. 71 // Unowned pointer.
70 ProfileOAuth2TokenService* token_service_; 72 ProfileOAuth2TokenService* token_service_;
71 std::string account_id_; 73 std::string account_id_;
72 std::string full_account_id_; 74 std::string full_account_id_;
73 75
74 // Owned by content::BrowserContent. Used to isolate cookies for auth server 76 // Owned by content::BrowserContent. Used to isolate cookies for auth server
75 // communication and shared with ARC OptIn UI platform app. 77 // communication and shared with ARC OptIn UI platform app.
76 content::StoragePartition* storage_partition_ = nullptr; 78 content::StoragePartition* storage_partition_ = nullptr;
77 79
78 PrepareCallback callback_; 80 PrepareCallback callback_;
79 bool context_prepared_ = false; 81 bool context_prepared_ = false;
80 82
83 // Defines retry logic in case of transient error.
84 net::BackoffEntry retry_backoff_;
85
81 base::OneShotTimer refresh_token_timeout_; 86 base::OneShotTimer refresh_token_timeout_;
87 base::OneShotTimer retry_timeout_;
82 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_; 88 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_;
83 std::unique_ptr<UbertokenFetcher> ubertoken_fetcher_; 89 std::unique_ptr<UbertokenFetcher> ubertoken_fetcher_;
84 90
85 DISALLOW_COPY_AND_ASSIGN(ArcAuthContext); 91 DISALLOW_COPY_AND_ASSIGN(ArcAuthContext);
86 }; 92 };
87 93
88 } // namespace arc 94 } // namespace arc
89 95
90 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ 96 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698