Chromium Code Reviews

Side by Side Diff: extensions/renderer/api/display_source/display_source_session.h

Issue 1540563002: [chrome.displaySource] Add WiFi Display session class skeleton and mojo service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_ 5 #ifndef EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_
6 #define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_ 6 #define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "extensions/common/api/display_source.h" 10 #include "extensions/common/api/display_source.h"
11 #include "third_party/WebKit/public/web/WebDOMMediaStreamTrack.h" 11 #include "third_party/WebKit/public/web/WebDOMMediaStreamTrack.h"
12 12
13 namespace content {
14 class RenderFrame;
15 }
16
13 namespace extensions { 17 namespace extensions {
14 18
15 using DisplaySourceAuthInfo = api::display_source::AuthenticationInfo; 19 using DisplaySourceAuthInfo = api::display_source::AuthenticationInfo;
20 using DisplaySourceAuthMethod = api::display_source::AuthenticationMethod;
16 using DisplaySourceErrorType = api::display_source::ErrorType; 21 using DisplaySourceErrorType = api::display_source::ErrorType;
17 22
18 // This class represents a generic display source session interface. 23 // This class represents a generic display source session interface.
19 class DisplaySourceSession { 24 class DisplaySourceSession {
20 public: 25 public:
21 using SinkIdCallback = base::Callback<void(int sink_id)>; 26 using SinkIdCallback = base::Callback<void(int sink_id)>;
22 using ErrorCallback = 27 using ErrorCallback =
23 base::Callback<void(int sink_id, 28 base::Callback<void(int sink_id,
24 DisplaySourceErrorType error_type, 29 DisplaySourceErrorType error_type,
25 const std::string& error_description)>; 30 const std::string& error_description)>;
(...skipping 45 matching lines...)
71 76
72 State state_; 77 State state_;
73 SinkIdCallback started_callback_; 78 SinkIdCallback started_callback_;
74 SinkIdCallback terminated_callback_; 79 SinkIdCallback terminated_callback_;
75 ErrorCallback error_callback_; 80 ErrorCallback error_callback_;
76 81
77 private: 82 private:
78 DISALLOW_COPY_AND_ASSIGN(DisplaySourceSession); 83 DISALLOW_COPY_AND_ASSIGN(DisplaySourceSession);
79 }; 84 };
80 85
86 struct DisplaySourceSessionParams {
87 DisplaySourceSessionParams();
88 ~DisplaySourceSessionParams();
89
90 int sink_id;
91 blink::WebMediaStreamTrack video_track;
92 blink::WebMediaStreamTrack audio_track;
93 DisplaySourceAuthMethod auth_method;
94 std::string auth_data;
95 content::RenderFrame* render_frame;
96 };
97
81 class DisplaySourceSessionFactory { 98 class DisplaySourceSessionFactory {
82 public: 99 public:
83 static scoped_ptr<DisplaySourceSession> CreateSession( 100 static scoped_ptr<DisplaySourceSession> CreateSession(
84 int sink_id, 101 const DisplaySourceSessionParams& params);
85 const blink::WebMediaStreamTrack& video_track,
86 const blink::WebMediaStreamTrack& audio_track,
87 scoped_ptr<DisplaySourceAuthInfo> auth_info);
88 private: 102 private:
89 DISALLOW_COPY_AND_ASSIGN(DisplaySourceSessionFactory); 103 DISALLOW_COPY_AND_ASSIGN(DisplaySourceSessionFactory);
90 }; 104 };
91 105
92 } // namespace extensions 106 } // namespace extensions
93 107
94 #endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_ 108 #endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_SESSION_H_
OLDNEW

Powered by Google App Engine