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

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: Updated comments and changed test to use a testing::Test class 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
« 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..1487cd935172bad51991c0dbda429dd58b72a4e8 100644
--- a/blimp/client/core/blimp_client_context_impl.h
+++ b/blimp/client/core/blimp_client_context_impl.h
@@ -5,10 +5,20 @@
#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/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.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,9 +34,13 @@ 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();
+ // 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);
~BlimpClientContextImpl() override;
#if defined(OS_ANDROID)
@@ -40,9 +54,29 @@ 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:
+ // Provides functionality from the embedder.
BlimpClientContextDelegate* delegate_;
+ // The task runner to use for IO operations.
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
+
+ // Collects details of network, such as number of commits and bytes
+ // transferred over network. Owned by ClientNetworkComponents.
+ 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