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

Unified Diff: remoting/webapp/host_native_messaging.js

Issue 16236008: Send enums as strings between Chromoting Native Messaging host and web-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« remoting/host/setup/native_messaging_host.cc ('K') | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_native_messaging.js
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js
index 8ed628c9120bc2309a0b779d0674673677b773b0..18117371d31cfbe97947e97d348cc22c6d4d7a43 100644
--- a/remoting/webapp/host_native_messaging.js
+++ b/remoting/webapp/host_native_messaging.js
@@ -109,11 +109,11 @@ function checkType_(name, object, type) {
* @return {remoting.HostController.AsyncResult?} Converted result.
*/
function asAsyncResult_(result) {
- if (!checkType_('result', result, 'number')) {
+ if (!checkType_('result', result, 'string')) {
return null;
}
for (var i in remoting.HostController.AsyncResult) {
- if (remoting.HostController.AsyncResult[i] == result) {
+ if (i == result) {
return remoting.HostController.AsyncResult[i];
}
}
@@ -129,11 +129,11 @@ function asAsyncResult_(result) {
* @return {remoting.HostController.State?} Converted result.
*/
function asHostState_(result) {
- if (!checkType_('result', result, 'number')) {
+ if (!checkType_('result', result, 'string')) {
return null;
}
for (var i in remoting.HostController.State) {
Sergey Ulanov 2013/05/30 23:14:52 You can replace this loop with: if (result in rem
Lambros 2013/05/31 01:32:56 Nice! Done.
- if (remoting.HostController.State[i] == result) {
+ if (i == result) {
return remoting.HostController.State[i];
}
}
« remoting/host/setup/native_messaging_host.cc ('K') | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698