summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/resources
diff options
context:
space:
mode:
authormikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>2016-02-26 02:48:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-26 10:49:03 +0000
commitef88b05837e968daf0389fce203c81dba16c17ed (patch)
treeb7c3b092eae814e263f999556c4957f4060abcf5 /extensions/renderer/resources
parent9c7c38629b18307b8d03e3cdeca0ebb37e2b978c (diff)
downloadchromium_src-ef88b05837e968daf0389fce203c81dba16c17ed.zip
chromium_src-ef88b05837e968daf0389fce203c81dba16c17ed.tar.gz
chromium_src-ef88b05837e968daf0389fce203c81dba16c17ed.tar.bz2
[chrome.displaySource] further implementation of call completion callbacks
The API implementation determines when and with which arguments the 'startSession'/'terminateSession' completion callbacks are invoked. The 'exceeded_session_limit_error' session error type is eliminated and substituted with 'startSession' completion callback call (which is more natural since this problem is detected before a new session is started). JS bindings code is simplified. BUG=242107 Review URL: https://codereview.chromium.org/1730583002 Cr-Commit-Position: refs/heads/master@{#377864}
Diffstat (limited to 'extensions/renderer/resources')
-rw-r--r--extensions/renderer/resources/display_source_custom_bindings.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/renderer/resources/display_source_custom_bindings.js b/extensions/renderer/resources/display_source_custom_bindings.js
index a1345ff..38d7e3c 100644
--- a/extensions/renderer/resources/display_source_custom_bindings.js
+++ b/extensions/renderer/resources/display_source_custom_bindings.js
@@ -18,7 +18,7 @@ function callbackWrapper(callback, method, message) {
try {
if (message !== null)
- lastError.set('displaySource.startSession', message, null, chrome);
+ lastError.set(method, message, null, chrome);
callback();
} finally {
lastError.clear(chrome);
@@ -40,7 +40,7 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) {
apiFunctions.setHandleRequest(
'startSession', function(sessionInfo, callback) {
try {
- var callId = natives.StartSession(sessionInfo, callbackWrapper);
+ var callId = natives.StartSession(sessionInfo);
callbacksInfo[callId] = {
callback: callback,
method: 'displaySource.startSession'
@@ -52,7 +52,7 @@ binding.registerCustomHook(function(bindingsAPI, extensionId) {
apiFunctions.setHandleRequest(
'terminateSession', function(sink_id, callback) {
try {
- var callId = natives.TerminateSession(sink_id, callbackWrapper);
+ var callId = natives.TerminateSession(sink_id);
callbacksInfo[callId] = {
callback: callback,
method: 'displaySource.terminateSession'