aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/onedrive/onedrivestorage.h
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-26 21:40:01 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit8f6bcdf55da97db98384c2a8cb9dcdf34232ac35 (patch)
treea1ec4f773c2891cf432f05af2461ca161959a017 /backends/cloud/onedrive/onedrivestorage.h
parentb246c17850687e7b15b644b761fbfe835ffc1c32 (diff)
downloadscummvm-rg350-8f6bcdf55da97db98384c2a8cb9dcdf34232ac35.tar.gz
scummvm-rg350-8f6bcdf55da97db98384c2a8cb9dcdf34232ac35.tar.bz2
scummvm-rg350-8f6bcdf55da97db98384c2a8cb9dcdf34232ac35.zip
CLOUD: Add OneDriveTokenRefresher
OneDriveTokenRefresher is a CurlJsonRequest replacement for OneDriveStorage methods. It behaves very similarly, but checks received JSON before passing it to user. If it contains "error" key, it attempts to refresh the token through OneDriveStorage, and then restarts the original request, so user won't notice that there ever was an error.
Diffstat (limited to 'backends/cloud/onedrive/onedrivestorage.h')
-rw-r--r--backends/cloud/onedrive/onedrivestorage.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/backends/cloud/onedrive/onedrivestorage.h b/backends/cloud/onedrive/onedrivestorage.h
index 1cb7017d64..e120691a08 100644
--- a/backends/cloud/onedrive/onedrivestorage.h
+++ b/backends/cloud/onedrive/onedrivestorage.h
@@ -44,12 +44,6 @@ class OneDriveStorage: public Cloud::Storage {
*/
OneDriveStorage(Common::String code);
- /**
- * Gets new access_token. If <code> passed is "", refresh_token is used.
- * Use "" in order to refresh token and pass a callback, so you could
- * continue your work when new token is available.
- */
- void getAccessToken(BoolCallback callback, Common::String code = "");
void tokenRefreshed(BoolCallback callback, Networking::RequestJsonPair pair);
void codeFlowComplete(RequestBoolPair pair);
@@ -122,6 +116,15 @@ public:
* Show message with OneDrive auth instructions. (Temporary)
*/
static void authThroughConsole();
+
+ /**
+ * Gets new access_token. If <code> passed is "", refresh_token is used.
+ * Use "" in order to refresh token and pass a callback, so you could
+ * continue your work when new token is available.
+ */
+ void getAccessToken(BoolCallback callback, Common::String code = "");
+
+ Common::String accessToken() { return _token; }
};
} //end of namespace OneDrive