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

Unified Diff: blimp/client/core/blimp_client_context_impl.h

Issue 2211613002: Add AssignmentSource to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge origin/master Created 4 years, 4 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: blimp/client/core/blimp_client_context_impl.h
diff --git a/blimp/client/core/blimp_client_context_impl.h b/blimp/client/core/blimp_client_context_impl.h
index 8f8ab63d0386e08ac1cc976b168b880c4a04fb88..dfc184bb8da929436f069398de4935e5f445b9fc 100644
--- a/blimp/client/core/blimp_client_context_impl.h
+++ b/blimp/client/core/blimp_client_context_impl.h
@@ -16,8 +16,10 @@
#include "blimp/client/core/session/network_event_observer.h"
#include "blimp/client/public/blimp_client_context.h"
#include "blimp/client/public/contents/blimp_contents.h"
+#include "blimp/client/public/session/assignment.h"
#include "blimp/net/blimp_connection_statistics.h"
#include "blimp/net/thread_pipe_manager.h"
+#include "url/gurl.h"
namespace blimp {
namespace client {
@@ -31,25 +33,46 @@ class BlimpClientContextImpl : public BlimpClientContext,
public:
// The |io_thread_task_runner| must be the task runner to use for IO
// operations.
- explicit BlimpClientContextImpl(
- scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner);
+ // The |file_thread_task_runner| must be the task runner to use for file
+ // operations.
+ BlimpClientContextImpl(
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner);
~BlimpClientContextImpl() override;
// BlimpClientContext implementation.
void SetDelegate(BlimpClientContextDelegate* delegate) override;
std::unique_ptr<BlimpContents> CreateBlimpContents() override;
+ void Connect(const std::string& client_auth_token) override;
// NetworkEventObserver implementation.
void OnConnected() override;
void OnDisconnected(int result) override;
+ protected:
+ // Returns the URL to use for connections to the assigner. Used to construct
+ // the AssignmentSource.
+ virtual GURL GetAssignerURL();
+
private:
+ // The AssignmentCallback for when an assignment is ready. This will trigger
+ // a connection to the engine.
+ virtual void ConnectWithAssignment(AssignmentRequestResult result,
+ const Assignment& assignment);
+
// Provides functionality from the embedder.
- BlimpClientContextDelegate* delegate_;
+ BlimpClientContextDelegate* delegate_ = nullptr;
// The task runner to use for IO operations.
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
+ // The task runner to use for file operations.
+ scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_;
+
+ // The AssignmentSource is used when the user of BlimpClientContextImpl calls
+ // Connect() to get a valid assignment and later connect to the engine.
+ std::unique_ptr<AssignmentSource> assignment_source_;
+
// Collects details of network, such as number of commits and bytes
// transferred over network. Owned by ClientNetworkComponents.
BlimpConnectionStatistics* blimp_connection_statistics_;

Powered by Google App Engine
This is Rietveld 408576698