diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 00:26:39 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 00:26:39 +0000 |
commit | 2cbb7dc21783219787b41dcc829b4020e221cc5a (patch) | |
tree | b8f390817c966fdb8607b04f48b3a294d5bae922 | |
parent | cd9fc3a02e00777d15fbcae5e6243ec071353b8c (diff) | |
download | chromium_src-2cbb7dc21783219787b41dcc829b4020e221cc5a.zip chromium_src-2cbb7dc21783219787b41dcc829b4020e221cc5a.tar.gz chromium_src-2cbb7dc21783219787b41dcc829b4020e221cc5a.tar.bz2 |
Use camelCase for JSON key names in Chromoting Native Messaging interface
JavaScript style guide says to use camelCase for field names of objects.
Seems reasonable to apply this to the JSON objects sent to the Native
Messaging host process.
BUG=232135
Review URL: https://chromiumcodereview.appspot.com/16266007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203528 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/host/setup/native_messaging_host.cc | 6 | ||||
-rw-r--r-- | remoting/host/setup/native_messaging_host_unittest.cc | 6 | ||||
-rw-r--r-- | remoting/webapp/host_native_messaging.js | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/remoting/host/setup/native_messaging_host.cc b/remoting/host/setup/native_messaging_host.cc index 28a0b10..2d2bd9ed 100644 --- a/remoting/host/setup/native_messaging_host.cc +++ b/remoting/host/setup/native_messaging_host.cc @@ -167,8 +167,8 @@ bool NativeMessagingHost::ProcessGenerateKeyPair( const base::DictionaryValue& message, scoped_ptr<base::DictionaryValue> response) { scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::Generate(); - response->SetString("private_key", key_pair->ToString()); - response->SetString("public_key", key_pair->GetPublicKey()); + response->SetString("privateKey", key_pair->ToString()); + response->SetString("publicKey", key_pair->GetPublicKey()); SendResponse(response.Pass()); return true; } @@ -276,7 +276,7 @@ void NativeMessagingHost::SendUsageStatsConsentResponse( bool set_by_policy) { response->SetBoolean("supported", supported); response->SetBoolean("allowed", allowed); - response->SetBoolean("set_by_policy", set_by_policy); + response->SetBoolean("setByPolicy", set_by_policy); SendResponse(response.Pass()); } diff --git a/remoting/host/setup/native_messaging_host_unittest.cc b/remoting/host/setup/native_messaging_host_unittest.cc index b6fc4ab..f71fa3c 100644 --- a/remoting/host/setup/native_messaging_host_unittest.cc +++ b/remoting/host/setup/native_messaging_host_unittest.cc @@ -52,8 +52,8 @@ void VerifyGenerateKeyPairResponse(const base::DictionaryValue* response) { std::string value; EXPECT_TRUE(response->GetString("type", &value)); EXPECT_EQ("generateKeyPairResponse", value); - EXPECT_TRUE(response->GetString("private_key", &value)); - EXPECT_TRUE(response->GetString("public_key", &value)); + EXPECT_TRUE(response->GetString("privateKey", &value)); + EXPECT_TRUE(response->GetString("publicKey", &value)); } void VerifyGetDaemonConfigResponse(const base::DictionaryValue* response) { @@ -74,7 +74,7 @@ void VerifyGetUsageStatsConsentResponse(const base::DictionaryValue* response) { bool supported, allowed, set_by_policy; EXPECT_TRUE(response->GetBoolean("supported", &supported)); EXPECT_TRUE(response->GetBoolean("allowed", &allowed)); - EXPECT_TRUE(response->GetBoolean("set_by_policy", &set_by_policy)); + EXPECT_TRUE(response->GetBoolean("setByPolicy", &set_by_policy)); EXPECT_TRUE(supported); EXPECT_TRUE(allowed); EXPECT_TRUE(set_by_policy); diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js index 8ed628c..51180b1 100644 --- a/remoting/webapp/host_native_messaging.js +++ b/remoting/webapp/host_native_messaging.js @@ -233,12 +233,12 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { case 'generateKeyPairResponse': /** @type {*} */ - var private_key = message['private_key']; + var privateKey = message['privateKey']; /** @type {*} */ - var public_key = message['public_key']; - if (checkType_('private_key', private_key, 'string') && - checkType_('public_key', public_key, 'string')) { - callback(private_key, public_key); + var publicKey = message['publicKey']; + if (checkType_('privateKey', privateKey, 'string') && + checkType_('publicKey', publicKey, 'string')) { + callback(privateKey, publicKey); } break; @@ -263,11 +263,11 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { /** @type {*} */ var allowed = message['allowed']; /** @type {*} */ - var set_by_policy = message['set_by_policy']; + var setByPolicy = message['setByPolicy']; if (checkType_('supported', supported, 'boolean') && checkType_('allowed', allowed, 'boolean') && - checkType_('set_by_policy', set_by_policy, 'boolean')) { - callback(supported, allowed, set_by_policy); + checkType_('setByPolicy', setByPolicy, 'boolean')) { + callback(supported, allowed, setByPolicy); } break; |