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

Side by Side Diff: content/browser/presentation/presentation_service_impl.h

Issue 2470023002: [Presentation API] change initial state of PresentationConnection to 'connecting' (Closed)
Patch Set: resolve code review comments from Derek and rebase with master Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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 ListenForConnectionStateChange); 95 ListenForConnectionStateChangeAndChangeState);
96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
97 ListenForConnectionClose); 97 ListenForConnectionClose);
98 98
99 // Maximum number of pending JoinSession requests at any given time. 99 // Maximum number of pending JoinSession requests at any given time.
100 static const int kMaxNumQueuedSessionRequests = 10; 100 static const int kMaxNumQueuedSessionRequests = 10;
101 101
102 using SessionMessagesCallback = 102 using SessionMessagesCallback =
103 base::Callback<void(mojo::Array<blink::mojom::SessionMessagePtr>)>; 103 base::Callback<void(mojo::Array<blink::mojom::SessionMessagePtr>)>;
104 using SendSessionMessageCallback = base::Callback<void(bool)>; 104 using SendSessionMessageCallback = base::Callback<void(bool)>;
105 105
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 const PresentationError& error); 215 const PresentationError& error);
216 void OnJoinSessionSucceeded( 216 void OnJoinSessionSucceeded(
217 int request_session_id, 217 int request_session_id,
218 const PresentationSessionInfo& session_info); 218 const PresentationSessionInfo& session_info);
219 void OnJoinSessionError( 219 void OnJoinSessionError(
220 int request_session_id, 220 int request_session_id,
221 const PresentationError& error); 221 const PresentationError& error);
222 void OnSendMessageCallback(bool sent); 222 void OnSendMessageCallback(bool sent);
223 223
224 // Calls to |delegate_| to start listening for state changes for |connection|. 224 // Calls to |delegate_| to start listening for state changes for |connection|.
225 // State changes will be returned via |OnConnectionStateChanged|. 225 // State changes will be returned via |OnConnectionStateChanged|. Change
226 void ListenForConnectionStateChange( 226 // |connection|'s state to 'connected' after listening.
227 void ListenForConnectionStateChangeAndChangeState(
227 const PresentationSessionInfo& connection); 228 const PresentationSessionInfo& connection);
228 229
229 // Passed to embedder's implementation of PresentationServiceDelegate for 230 // Passed to embedder's implementation of PresentationServiceDelegate for
230 // later invocation when session messages arrive. 231 // later invocation when session messages arrive.
231 void OnSessionMessages( 232 void OnSessionMessages(
232 const content::PresentationSessionInfo& session, 233 const content::PresentationSessionInfo& session,
233 const ScopedVector<PresentationSessionMessage>& messages, 234 const ScopedVector<PresentationSessionMessage>& messages,
234 bool pass_ownership); 235 bool pass_ownership);
235 236
236 // Associates a JoinSession |callback| with a unique request ID and 237 // Associates a JoinSession |callback| with a unique request ID and
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 286
286 // NOTE: Weak pointers must be invalidated before all other member variables. 287 // NOTE: Weak pointers must be invalidated before all other member variables.
287 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; 288 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_;
288 289
289 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); 290 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl);
290 }; 291 };
291 292
292 } // namespace content 293 } // namespace content
293 294
294 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ 295 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/test/media_router/resources/common.js ('k') | content/browser/presentation/presentation_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698