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

Side by Side Diff: blimp/client/core/context/assignment_fetcher.h

Issue 2406403003: Clean up Assignment Create in BlimpClientContextImpl. (Closed)
Patch Set: Moves GetGURL up to protected. Created 4 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_CORE_CONTEXT_ASSIGNMENT_FETCHER_H_
6 #define BLIMP_CLIENT_CORE_CONTEXT_ASSIGNMENT_FETCHER_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "blimp/client/core/session/assignment_source.h"
12 #include "blimp/client/core/session/identity_source.h"
13
14 namespace blimp {
15 namespace client {
16
17 class AssignmentFetcher {
18 public:
19 AssignmentFetcher(
20 std::unique_ptr<IdentityProvider> identity_provider,
21 const base::Callback<void(const GoogleServiceAuthError&)> error_callback,
David Trainor- moved to gerrit 2016/10/20 16:50:32 using AuthErrorCallback = base::Callback<void(cons
CJ 2016/10/20 20:52:57 Done.
22 GURL assigner_url,
23 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
24 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner);
25
26 ~AssignmentFetcher();
27
28 void Fetch(base::Callback<void(AssignmentRequestResult, const Assignment&)>
David Trainor- moved to gerrit 2016/10/20 16:50:32 Hmm what do you think? Now that I'm looking at th
CJ 2016/10/20 20:52:57 Sounds good to me. It doesn't even make testing ea
29 assignment_receieved_callback);
David Trainor- moved to gerrit 2016/10/20 16:50:32 receieved -> received
CJ 2016/10/20 20:52:57 Done.
30
31 IdentitySource* GetIdentitySource();
David Trainor- moved to gerrit 2016/10/20 16:50:32 Do we still have to expose this?
CJ 2016/10/20 20:52:57 I believe so. BlimpClientContextImpl is expected t
32
33 private:
34 // Called when an OAuth2 token is received. Will then ask the
35 // AssignmentSource for an Assignment with this token.
36 void OnAuthTokenReceived(const std::string& client_auth_token);
37
38 // Provide OAuth2 token and propagate account sign in states change.
39 std::unique_ptr<IdentitySource> identity_source_;
David Trainor- moved to gerrit 2016/10/20 16:50:32 Yay!
CJ 2016/10/20 20:52:58 Acknowledged.
40
41 GURL assigner_url_;
David Trainor- moved to gerrit 2016/10/20 16:50:32 The comments still seemed valid :).
CJ 2016/10/20 20:52:58 Done.
42
43 base::Callback<void(AssignmentRequestResult, const Assignment&)>
44 assignment_received_callback_;
45
46 // The task runner to use for IO operations.
47 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
48
49 // The task runner to use for file operations.
50 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_;
51
52 // The AssignmentSource is used when the user of AssignmentFetcher calls
53 // Fetch() to get a valid assignment and later connect to the engine.
54 std::unique_ptr<AssignmentSource> assignment_source_;
55
56 DISALLOW_COPY_AND_ASSIGN(AssignmentFetcher);
57 };
58
59 } // namespace client
60 } // namespace blimp
61
62 #endif // BLIMP_CLIENT_CORE_CONTEXT_ASSIGNMENT_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698