Chromium Code Reviews| 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); |
| }; |