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/identity_source.h" | |
16 #include "blimp/client/core/session/network_event_observer.h" | 17 #include "blimp/client/core/session/network_event_observer.h" |
17 #include "blimp/client/public/blimp_client_context.h" | 18 #include "blimp/client/public/blimp_client_context.h" |
18 #include "blimp/client/public/contents/blimp_contents.h" | 19 #include "blimp/client/public/contents/blimp_contents.h" |
19 #include "blimp/client/public/session/assignment.h" | 20 #include "blimp/client/public/session/assignment.h" |
20 #include "blimp/net/blimp_connection_statistics.h" | 21 #include "blimp/net/blimp_connection_statistics.h" |
21 #include "blimp/net/thread_pipe_manager.h" | 22 #include "blimp/net/thread_pipe_manager.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 namespace blimp { | 25 namespace blimp { |
25 namespace client { | 26 namespace client { |
(...skipping 11 matching lines...) Expand all Loading... | |
37 // operations. | 38 // operations. |
38 BlimpClientContextImpl( | 39 BlimpClientContextImpl( |
39 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
40 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner); | 41 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner); |
41 ~BlimpClientContextImpl() override; | 42 ~BlimpClientContextImpl() override; |
42 | 43 |
43 // BlimpClientContext implementation. | 44 // BlimpClientContext implementation. |
44 void SetDelegate(BlimpClientContextDelegate* delegate) override; | 45 void SetDelegate(BlimpClientContextDelegate* delegate) override; |
45 std::unique_ptr<BlimpContents> CreateBlimpContents() override; | 46 std::unique_ptr<BlimpContents> CreateBlimpContents() override; |
46 void Connect(const std::string& client_auth_token) override; | 47 void Connect(const std::string& client_auth_token) override; |
48 void Connect() override; | |
47 | 49 |
48 // NetworkEventObserver implementation. | 50 // NetworkEventObserver implementation. |
49 void OnConnected() override; | 51 void OnConnected() override; |
50 void OnDisconnected(int result) override; | 52 void OnDisconnected(int result) override; |
51 | 53 |
52 protected: | 54 protected: |
53 // Returns the URL to use for connections to the assigner. Used to construct | 55 // Returns the URL to use for connections to the assigner. Used to construct |
54 // the AssignmentSource. | 56 // the AssignmentSource. |
55 virtual GURL GetAssignerURL(); | 57 virtual GURL GetAssignerURL(); |
56 | 58 |
(...skipping 21 matching lines...) Expand all Loading... | |
78 BlimpConnectionStatistics* blimp_connection_statistics_; | 80 BlimpConnectionStatistics* blimp_connection_statistics_; |
79 | 81 |
80 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; | 82 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; |
81 | 83 |
82 // Container struct for network components. | 84 // Container struct for network components. |
83 // Must be deleted on the IO thread. | 85 // Must be deleted on the IO thread. |
84 std::unique_ptr<ClientNetworkComponents> net_components_; | 86 std::unique_ptr<ClientNetworkComponents> net_components_; |
85 | 87 |
86 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; | 88 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; |
87 | 89 |
90 std::unique_ptr<IdentitySource> identity_source_; | |
nyquist
2016/08/12 05:47:04
Could you explain what this is used for?
xingliu
2016/08/12 21:11:18
Done.
| |
91 | |
88 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; | 92 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; |
89 | 93 |
90 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); | 94 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace client | 97 } // namespace client |
94 } // namespace blimp | 98 } // namespace blimp |
95 | 99 |
96 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ | 100 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ |
OLD | NEW |