| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 5 #ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| 6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "blimp/client/core/session/client_network_components.h" | 15 #include "blimp/client/core/session/client_network_components.h" |
| 16 #include "blimp/client/core/session/network_event_observer.h" | 16 #include "blimp/client/core/session/network_event_observer.h" |
| 17 #include "blimp/client/public/blimp_client_context.h" | 17 #include "blimp/client/public/blimp_client_context.h" |
| 18 #include "blimp/client/public/contents/blimp_contents.h" | 18 #include "blimp/client/public/contents/blimp_contents.h" |
| 19 #include "blimp/net/blimp_connection_statistics.h" | 19 #include "blimp/net/blimp_connection_statistics.h" |
| 20 #include "blimp/net/thread_pipe_manager.h" | 20 #include "blimp/net/thread_pipe_manager.h" |
| 21 | 21 |
| 22 namespace blimp { | 22 namespace blimp { |
| 23 namespace client { | 23 namespace client { |
| 24 | 24 |
| 25 class BlimpContentsManager; |
| 26 |
| 25 // BlimpClientContextImpl is the implementation of the main context-class for | 27 // BlimpClientContextImpl is the implementation of the main context-class for |
| 26 // the blimp client. | 28 // the blimp client. |
| 27 class BlimpClientContextImpl : public BlimpClientContext, | 29 class BlimpClientContextImpl : public BlimpClientContext, |
| 28 public NetworkEventObserver { | 30 public NetworkEventObserver { |
| 29 public: | 31 public: |
| 30 // The |io_thread_task_runner| must be the task runner to use for IO | 32 // The |io_thread_task_runner| must be the task runner to use for IO |
| 31 // operations. | 33 // operations. |
| 32 explicit BlimpClientContextImpl( | 34 explicit BlimpClientContextImpl( |
| 33 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); | 35 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); |
| 34 ~BlimpClientContextImpl() override; | 36 ~BlimpClientContextImpl() override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 // Provides functionality from the embedder. | 47 // Provides functionality from the embedder. |
| 46 BlimpClientContextDelegate* delegate_; | 48 BlimpClientContextDelegate* delegate_; |
| 47 | 49 |
| 48 // The task runner to use for IO operations. | 50 // The task runner to use for IO operations. |
| 49 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; | 51 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| 50 | 52 |
| 51 // Collects details of network, such as number of commits and bytes | 53 // Collects details of network, such as number of commits and bytes |
| 52 // transferred over network. Owned by ClientNetworkComponents. | 54 // transferred over network. Owned by ClientNetworkComponents. |
| 53 BlimpConnectionStatistics* blimp_connection_statistics_; | 55 BlimpConnectionStatistics* blimp_connection_statistics_; |
| 54 | 56 |
| 57 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; |
| 58 |
| 55 // Container struct for network components. | 59 // Container struct for network components. |
| 56 // Must be deleted on the IO thread. | 60 // Must be deleted on the IO thread. |
| 57 std::unique_ptr<ClientNetworkComponents> net_components_; | 61 std::unique_ptr<ClientNetworkComponents> net_components_; |
| 58 | 62 |
| 59 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; | 63 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; |
| 60 | 64 |
| 61 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; | 65 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; |
| 62 | 66 |
| 63 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); | 67 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace client | 70 } // namespace client |
| 67 } // namespace blimp | 71 } // namespace blimp |
| 68 | 72 |
| 69 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 73 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
| OLD | NEW |