OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ListenForDefaultSessionStartAfterSet); | 85 ListenForDefaultSessionStartAfterSet); |
86 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 86 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
87 DefaultSessionStartReset); | 87 DefaultSessionStartReset); |
88 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 88 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
89 ReceiveConnectionMessagesAfterReset); | 89 ReceiveConnectionMessagesAfterReset); |
90 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 90 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
91 MaxPendingStartSessionRequests); | 91 MaxPendingStartSessionRequests); |
92 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 92 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
93 MaxPendingJoinSessionRequests); | 93 MaxPendingJoinSessionRequests); |
94 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 94 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
95 ListenForConnectionStateChangeAndChangeState); | 95 ListenForConnectionStateChange); |
96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
97 ListenForConnectionClose); | 97 ListenForConnectionClose); |
98 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 98 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
99 SetPresentationConnection); | 99 SetPresentationConnection); |
100 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 100 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
101 ReceiverPresentationServiceDelegate); | 101 ReceiverPresentationServiceDelegate); |
102 | 102 |
103 // Maximum number of pending JoinSession requests at any given time. | 103 // Maximum number of pending JoinSession requests at any given time. |
104 static const int kMaxNumQueuedSessionRequests = 10; | 104 static const int kMaxNumQueuedSessionRequests = 10; |
105 | 105 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const PresentationError& error); | 230 const PresentationError& error); |
231 void OnJoinSessionSucceeded( | 231 void OnJoinSessionSucceeded( |
232 int request_session_id, | 232 int request_session_id, |
233 const PresentationSessionInfo& session_info); | 233 const PresentationSessionInfo& session_info); |
234 void OnJoinSessionError( | 234 void OnJoinSessionError( |
235 int request_session_id, | 235 int request_session_id, |
236 const PresentationError& error); | 236 const PresentationError& error); |
237 void OnSendMessageCallback(bool sent); | 237 void OnSendMessageCallback(bool sent); |
238 | 238 |
239 // Calls to |delegate_| to start listening for state changes for |connection|. | 239 // Calls to |delegate_| to start listening for state changes for |connection|. |
240 // State changes will be returned via |OnConnectionStateChanged|. Change | 240 // State changes will be returned via |OnConnectionStateChanged|. |
241 // |connection|'s state to 'connected' after listening. | 241 void ListenForConnectionStateChange( |
242 void ListenForConnectionStateChangeAndChangeState( | |
243 const PresentationSessionInfo& connection); | 242 const PresentationSessionInfo& connection); |
244 | 243 |
245 // Passed to embedder's implementation of PresentationServiceDelegate for | 244 // Passed to embedder's implementation of PresentationServiceDelegate for |
246 // later invocation when session messages arrive. | 245 // later invocation when session messages arrive. |
247 void OnConnectionMessages( | 246 void OnConnectionMessages( |
248 const content::PresentationSessionInfo& session, | 247 const content::PresentationSessionInfo& session, |
249 const std::vector<std::unique_ptr<PresentationConnectionMessage>>& | 248 const std::vector<std::unique_ptr<PresentationConnectionMessage>>& |
250 messages, | 249 messages, |
251 bool pass_ownership); | 250 bool pass_ownership); |
252 | 251 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 319 |
321 // NOTE: Weak pointers must be invalidated before all other member variables. | 320 // NOTE: Weak pointers must be invalidated before all other member variables. |
322 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; | 321 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; |
323 | 322 |
324 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); | 323 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); |
325 }; | 324 }; |
326 | 325 |
327 } // namespace content | 326 } // namespace content |
328 | 327 |
329 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 328 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
OLD | NEW |