| Index: extensions/renderer/display_source_custom_bindings.h
|
| diff --git a/extensions/renderer/display_source_custom_bindings.h b/extensions/renderer/display_source_custom_bindings.h
|
| index 199f199b4663e968a780d31738b54c93f1c704b9..2a6544527df974602d7ed511aab0f1fa0cad20f3 100644
|
| --- a/extensions/renderer/display_source_custom_bindings.h
|
| +++ b/extensions/renderer/display_source_custom_bindings.h
|
| @@ -29,8 +29,12 @@ class DisplaySourceCustomBindings : public ObjectBackedNativeHandler {
|
| const v8::FunctionCallbackInfo<v8::Value>& args);
|
| void TerminateSession(
|
| const v8::FunctionCallbackInfo<v8::Value>& args);
|
| -
|
| - void DispatchSessionStarted(int sink_id) const;
|
| + // Call completion callbacks.
|
| + enum CallbackType { kStarted, kTerminated };
|
| + void CallCompletionCallback(int sink_id,
|
| + CallbackType type,
|
| + const std::string& error_message = "");
|
| + // Dispatch events
|
| void DispatchSessionTerminated(int sink_id) const;
|
| void DispatchSessionError(int sink_id,
|
| DisplaySourceErrorType type,
|
| @@ -46,6 +50,16 @@ class DisplaySourceCustomBindings : public ObjectBackedNativeHandler {
|
| DisplaySourceSession* GetDisplaySession(int sink_id) const;
|
|
|
| std::map<int, scoped_ptr<DisplaySourceSession>> session_map_;
|
| + // Data of a call completion callback.
|
| + struct CallbackInfo {
|
| + CallbackType type;
|
| + int sink_id;
|
| + int call_id; // Each call has a unique Id.
|
| + };
|
| +
|
| + CallbackInfo GetCallbackInfo(CallbackType type, int sink_id) const;
|
| +
|
| + std::vector<CallbackInfo> callbacks_;
|
| base::WeakPtrFactory<DisplaySourceCustomBindings> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DisplaySourceCustomBindings);
|
|
|