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

Unified Diff: extensions/renderer/display_source_custom_bindings.h

Issue 1730583002: [chrome.displaySource] further implementation of call completion callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from Antony Created 4 years, 10 months 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 side-by-side diff with in-line comments
Download patch
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 2a6544527df974602d7ed511aab0f1fa0cad20f3..72ff6a424addfaf1d045ed7948535c67b2623f57 100644
--- a/extensions/renderer/display_source_custom_bindings.h
+++ b/extensions/renderer/display_source_custom_bindings.h
@@ -30,18 +30,20 @@ class DisplaySourceCustomBindings : public ObjectBackedNativeHandler {
void TerminateSession(
const v8::FunctionCallbackInfo<v8::Value>& args);
// Call completion callbacks.
- enum CallbackType { kStarted, kTerminated };
- void CallCompletionCallback(int sink_id,
- CallbackType type,
- const std::string& error_message = "");
+ void OnCallCompleted(int call_id,
+ bool success,
+ const std::string& error_message);
+ void OnSessionStarted(int sink_id,
+ int call_id,
+ bool success,
+ const std::string& error_message);
// Dispatch events
void DispatchSessionTerminated(int sink_id) const;
void DispatchSessionError(int sink_id,
DisplaySourceErrorType type,
const std::string& message) const;
- // DisplaySession callbacks.
- void OnSessionStarted(int sink_id);
+ // DisplaySession notification callbacks.
void OnSessionTerminated(int sink_id);
void OnSessionError(int sink_id,
DisplaySourceErrorType type,
@@ -50,16 +52,6 @@ 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);

Powered by Google App Engine
This is Rietveld 408576698