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

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

Issue 2190753002: Add network setup code to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split-blimp-client-session
Patch Set: Created 4 years, 5 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
« no previous file with comments | « blimp/client/core/BUILD.gn ('k') | blimp/client/core/blimp_client_context_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d2414432a1279126c920f91b515beec5858b5198..968104a0fea04978fcecf6371ec74eb167273a4a 100644
--- a/blimp/client/core/blimp_client_context_impl.h
+++ b/blimp/client/core/blimp_client_context_impl.h
@@ -5,10 +5,18 @@
#ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_
#define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_
+#include <memory>
+
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/supports_user_data.h"
+#include "base/threading/thread.h"
+#include "blimp/client/core/session/client_network_components.h"
+#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/net/blimp_connection_statistics.h"
+#include "blimp/net/thread_pipe_manager.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
@@ -24,6 +32,7 @@ class BlimpClientContextImplAndroid;
// BlimpClientContextImpl is the implementation of the main context-class for
// the blimp client.
class BlimpClientContextImpl : public BlimpClientContext,
+ public NetworkEventObserver,
base::SupportsUserData {
public:
BlimpClientContextImpl();
@@ -40,9 +49,31 @@ class BlimpClientContextImpl : public BlimpClientContext,
void SetDelegate(BlimpClientContextDelegate* delegate) override;
std::unique_ptr<BlimpContents> CreateBlimpContents() override;
+ // NetworkEventObserver implementation.
+ void OnConnected() override;
+ void OnDisconnected(int result) override;
+
private:
+ // Registers the Blimp features. Called during construction to set up
+ // pointers to the network code.
+ void RegisterFeatures();
+
BlimpClientContextDelegate* delegate_;
+ base::Thread io_thread_;
nyquist 2016/07/27 22:48:46 Should the embedder provide a SequencedTaskRunner
Kevin M 2016/07/28 19:18:56 Or a SingleThreadTaskRunner?
nyquist 2016/07/28 22:08:31 Done.
+
+ // Collects details of network, such as number of commits and bytes
+ // transferred over network. Ownership is maintained on the IO thread.
+ BlimpConnectionStatistics* blimp_connection_statistics_;
+
+ // Container struct for network components.
+ // Must be deleted on the IO thread.
+ std::unique_ptr<ClientNetworkComponents> net_components_;
+
+ std::unique_ptr<ThreadPipeManager> thread_pipe_manager_;
+
+ base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl);
};
« no previous file with comments | « blimp/client/core/BUILD.gn ('k') | blimp/client/core/blimp_client_context_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698