| 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 ReceiveSessionMessagesAfterReset); | 89 ReceiveSessionMessagesAfterReset); |
| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 const PresentationError& error); | 227 const PresentationError& error); |
| 228 void OnJoinSessionSucceeded( | 228 void OnJoinSessionSucceeded( |
| 229 int request_session_id, | 229 int request_session_id, |
| 230 const PresentationSessionInfo& session_info); | 230 const PresentationSessionInfo& session_info); |
| 231 void OnJoinSessionError( | 231 void OnJoinSessionError( |
| 232 int request_session_id, | 232 int request_session_id, |
| 233 const PresentationError& error); | 233 const PresentationError& error); |
| 234 void OnSendMessageCallback(bool sent); | 234 void OnSendMessageCallback(bool sent); |
| 235 | 235 |
| 236 // Calls to |delegate_| to start listening for state changes for |connection|. | 236 // Calls to |delegate_| to start listening for state changes for |connection|. |
| 237 // State changes will be returned via |OnConnectionStateChanged|. Change | 237 // State changes will be returned via |OnConnectionStateChanged|. |
| 238 // |connection|'s state to 'connected' after listening. | 238 void ListenForConnectionStateChange( |
| 239 void ListenForConnectionStateChangeAndChangeState( | |
| 240 const PresentationSessionInfo& connection); | 239 const PresentationSessionInfo& connection); |
| 241 | 240 |
| 242 void OnSessionMessages( | 241 void OnSessionMessages( |
| 243 const content::PresentationSessionInfo& session, | 242 const content::PresentationSessionInfo& session, |
| 244 const ScopedVector<PresentationSessionMessage>& messages, | 243 const ScopedVector<PresentationSessionMessage>& messages, |
| 245 bool pass_ownership); | 244 bool pass_ownership); |
| 246 | 245 |
| 247 // A callback registered to OffscreenPresentationManager when | 246 // A callback registered to OffscreenPresentationManager when |
| 248 // the PresentationServiceImpl for the presentation receiver is initialized. | 247 // the PresentationServiceImpl for the presentation receiver is initialized. |
| 249 // Calls |client_| to create a new PresentationConnection on receiver page. | 248 // Calls |client_| to create a new PresentationConnection on receiver page. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 312 |
| 314 // NOTE: Weak pointers must be invalidated before all other member variables. | 313 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 315 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; | 314 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; |
| 316 | 315 |
| 317 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); | 316 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); |
| 318 }; | 317 }; |
| 319 | 318 |
| 320 } // namespace content | 319 } // namespace content |
| 321 | 320 |
| 322 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 321 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
| OLD | NEW |