Async calls performed by sendSyncMessage
authorRafal Galka <r.galka@samsung.com>
Tue, 3 Mar 2015 07:59:31 +0000 (08:59 +0100)
committerRafal Galka <r.galka@samsung.com>
Wed, 11 Mar 2015 10:21:38 +0000 (11:21 +0100)
[Message] Changes related to:
http://168.219.209.56/gerrit/#/c/15196

[Verification]
TCT results without change.

Change-Id: Ifad63fba9fe4453053e5472211f8791383a1c29e

27 files changed:
src/account/account_instance.cc
src/archive/archive_instance.cc
src/badge/badge_instance.cc
src/bluetooth/bluetooth_instance.cc
src/bookmark/bookmark_instance.cc
src/calendar/calendar_instance.cc
src/calendar/calendar_plugin.cc
src/callhistory/callhistory_instance.cc
src/contact/contact_instance.cc
src/content/content_instance.cc
src/exif/exif_instance.cc
src/filesystem/filesystem_instance.cc
src/messaging/messaging_instance.cc
src/networkbearerselection/networkbearerselection_instance.cc
src/nfc/nfc_instance.cc
src/power/power_instance.cc
src/push/push_instance.cc
src/radio/radio_instance.cc
src/secureelement/secureelement_instance.cc
src/sensor/sensor_instance.cc
src/sound/sound_instance.cc
src/systeminfo/systeminfo_instance.cc
src/systemsetting/systemsetting_instance.cc
src/time/time_instance.cc
src/tvchannel/tvchannel_instance.cc
src/tvdisplay/tvdisplay_instance.cc
src/websetting/websetting_instance.cc

index 07831e6..e2ddd73 100644 (file)
@@ -54,9 +54,11 @@ AccountInstance::AccountInstance() {
   manager_ = new AccountManager;
   subscribe_ = NULL;
 
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
   #define REGISTER_ASYNC(c,x) \
-    RegisterHandler(c, std::bind(&AccountInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&AccountInstance::x, this, _1, _2));
   REGISTER_ASYNC("AccountManager_getAccounts", AccountManagerGetAccounts);
   REGISTER_ASYNC("AccountManager_getProviders", AccountManagerGetProviders);
   REGISTER_ASYNC("Account_getExtendedData", AccountGetExtendedData);
index 137896a..c171606 100644 (file)
@@ -31,11 +31,13 @@ ArchiveInstance& ArchiveInstance::getInstance()
 ArchiveInstance::ArchiveInstance() {
     LoggerD("Entered");
 
-    using namespace std::placeholders;
+    using std::placeholders::_1;
+    using std::placeholders::_2;
+
     #define REGISTER_SYNC(c,x) \
-    RegisterSyncHandler(c, std::bind(&ArchiveInstance::x, this, _1, _2));
+        RegisterSyncHandler(c, std::bind(&ArchiveInstance::x, this, _1, _2));
     #define REGISTER_ASYNC(c,x) \
-    RegisterHandler(c, std::bind(&ArchiveInstance::x, this, _1, _2));
+        RegisterSyncHandler(c, std::bind(&ArchiveInstance::x, this, _1, _2));
 
     REGISTER_ASYNC("ArchiveManager_open", Open);
     REGISTER_SYNC("ArchiveManager_abort", Abort);
index 58f3cd6..f1e5e7e 100644 (file)
@@ -24,7 +24,9 @@ BadgeInstance& BadgeInstance::GetInstance() {
 }
 
 BadgeInstance::BadgeInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(c, std::bind(&BadgeInstance::x, this, _1, _2));
   REGISTER_SYNC("BadgeManager_setBadgeCount", BadgeManagerSetBadgeCount);
index 18751a5..91d3937 100644 (file)
@@ -52,78 +52,87 @@ BluetoothInstance& BluetoothInstance::GetInstance()
 BluetoothInstance::BluetoothInstance()
 {
   LoggerD("Entered");
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
+  #define REGISTER_ASYNC(c, func) \
+      RegisterSyncHandler(c, func);
+  #define REGISTER_SYNC(c, func) \
+      RegisterSyncHandler(c, func);
 
   // BluetoothAdapter
-  RegisterHandler("BluetoothAdapter_setName",
-                  std::bind(&BluetoothAdapter::SetName, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_setPowered",
-                  std::bind(&BluetoothAdapter::SetPowered, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_setVisible",
-                  std::bind(&BluetoothAdapter::SetVisible, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_discoverDevices",
-                      std::bind(&BluetoothAdapter::DiscoverDevices, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_stopDiscovery",
-                  std::bind(&BluetoothAdapter::StopDiscovery, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_getKnownDevices",
-                  std::bind(&BluetoothAdapter::GetKnownDevices, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_getDevice",
-                  std::bind(&BluetoothAdapter::GetDevice, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_createBonding",
-                  std::bind(&BluetoothAdapter::CreateBonding, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_destroyBonding",
-                  std::bind(&BluetoothAdapter::DestroyBonding, bluetooth_adapter, _1, _2));
-  RegisterHandler("BluetoothAdapter_registerRFCOMMServiceByUUID",
-                  std::bind(&BluetoothAdapter::RegisterRFCOMMServiceByUUID, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_getBluetoothProfileHandler",
-                      std::bind(&BluetoothAdapter::GetBluetoothProfileHandler, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_getName",
-                      std::bind(&BluetoothAdapter::GetName, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_getAddress",
-                      std::bind(&BluetoothAdapter::GetAddress, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_getPowered",
-                      std::bind(&BluetoothAdapter::GetPowered, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_getVisible",
-                      std::bind(&BluetoothAdapter::GetVisible, bluetooth_adapter, _1, _2));
-  RegisterSyncHandler("BluetoothAdapter_isServiceConnected",
-                      std::bind(&BluetoothAdapter::IsServiceConnected, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_setName",
+      std::bind(&BluetoothAdapter::SetName, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_setPowered",
+      std::bind(&BluetoothAdapter::SetPowered, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_setVisible",
+      std::bind(&BluetoothAdapter::SetVisible, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_discoverDevices",
+      std::bind(&BluetoothAdapter::DiscoverDevices, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_stopDiscovery",
+      std::bind(&BluetoothAdapter::StopDiscovery, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_getKnownDevices",
+      std::bind(&BluetoothAdapter::GetKnownDevices, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_getDevice",
+      std::bind(&BluetoothAdapter::GetDevice, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_createBonding",
+      std::bind(&BluetoothAdapter::CreateBonding, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_destroyBonding",
+      std::bind(&BluetoothAdapter::DestroyBonding, bluetooth_adapter, _1, _2));
+  REGISTER_ASYNC("BluetoothAdapter_registerRFCOMMServiceByUUID",
+      std::bind(&BluetoothAdapter::RegisterRFCOMMServiceByUUID, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_getBluetoothProfileHandler",
+      std::bind(&BluetoothAdapter::GetBluetoothProfileHandler, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_getName",
+      std::bind(&BluetoothAdapter::GetName, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_getAddress",
+      std::bind(&BluetoothAdapter::GetAddress, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_getPowered",
+      std::bind(&BluetoothAdapter::GetPowered, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_getVisible",
+      std::bind(&BluetoothAdapter::GetVisible, bluetooth_adapter, _1, _2));
+  REGISTER_SYNC("BluetoothAdapter_isServiceConnected",
+      std::bind(&BluetoothAdapter::IsServiceConnected, bluetooth_adapter, _1, _2));
 
   // BluetoothDevice
-  RegisterHandler("BluetoothDevice_connectToServiceByUUID",
-                  std::bind(&BluetoothDevice::ConnectToServiceByUUID, &bluetooth_device, _1, _2));
-  RegisterSyncHandler("BluetoothDevice_getBoolValue",
-                      std::bind(&BluetoothDevice::GetBoolValue, &bluetooth_device, _1, _2));
+  REGISTER_ASYNC("BluetoothDevice_connectToServiceByUUID",
+      std::bind(&BluetoothDevice::ConnectToServiceByUUID, &bluetooth_device, _1, _2));
+  REGISTER_SYNC("BluetoothDevice_getBoolValue",
+      std::bind(&BluetoothDevice::GetBoolValue, &bluetooth_device, _1, _2));
 
   // BluetoothHealthApplication
-  RegisterHandler("BluetoothHealthApplication_unregister",
-                  std::bind(&BluetoothHealthApplication::Unregister, &bluetooth_health_application, _1, _2));
+  REGISTER_ASYNC("BluetoothHealthApplication_unregister",
+      std::bind(&BluetoothHealthApplication::Unregister, &bluetooth_health_application, _1, _2));
 
   // BluetoothHealthChannel
-  RegisterSyncHandler("BluetoothHealthChannel_close",
-                      std::bind(&BluetoothHealthChannel::Close, &bluetooth_health_channel, _1, _2));
-  RegisterSyncHandler("BluetoothHealthChannel_sendData",
-                      std::bind(&BluetoothHealthChannel::SendData, &bluetooth_health_channel, _1, _2));
+  REGISTER_SYNC("BluetoothHealthChannel_close",
+      std::bind(&BluetoothHealthChannel::Close, &bluetooth_health_channel, _1, _2));
+  REGISTER_SYNC("BluetoothHealthChannel_sendData",
+      std::bind(&BluetoothHealthChannel::SendData, &bluetooth_health_channel, _1, _2));
 
   // BluetoothHealthProfileHandler
-  RegisterHandler("BluetoothHealthProfileHandler_registerSinkApp",
-                  std::bind(&BluetoothHealthProfileHandler::RegisterSinkApp, bluetooth_health_profile_handler, _1, _2));
-  RegisterHandler("BluetoothHealthProfileHandler_connectToSource",
-                  std::bind(&BluetoothHealthProfileHandler::ConnectToSource, bluetooth_health_profile_handler, _1, _2));
+  REGISTER_ASYNC("BluetoothHealthProfileHandler_registerSinkApp",
+      std::bind(&BluetoothHealthProfileHandler::RegisterSinkApp, bluetooth_health_profile_handler, _1, _2));
+  REGISTER_ASYNC("BluetoothHealthProfileHandler_connectToSource",
+      std::bind(&BluetoothHealthProfileHandler::ConnectToSource, bluetooth_health_profile_handler, _1, _2));
 
   // BluetoothServiceHandler
-  RegisterHandler("BluetoothServiceHandler_unregister",
-                  std::bind(&BluetoothServiceHandler::Unregister, &bluetooth_service_handler, _1, _2));
+  REGISTER_ASYNC("BluetoothServiceHandler_unregister",
+      std::bind(&BluetoothServiceHandler::Unregister, &bluetooth_service_handler, _1, _2));
 
   // BluetoothSocket
-  RegisterSyncHandler("BluetoothSocket_writeData",
-                      std::bind(&BluetoothSocket::WriteData, &bluetooth_socket, _1, _2));
-  RegisterSyncHandler("BluetoothSocket_readData",
-                      std::bind(&BluetoothSocket::ReadData, &bluetooth_socket, _1, _2));
-  RegisterSyncHandler("BluetoothSocket_close",
-                      std::bind(&BluetoothSocket::Close, &bluetooth_socket, _1, _2));
+  REGISTER_SYNC("BluetoothSocket_writeData",
+      std::bind(&BluetoothSocket::WriteData, &bluetooth_socket, _1, _2));
+  REGISTER_SYNC("BluetoothSocket_readData",
+      std::bind(&BluetoothSocket::ReadData, &bluetooth_socket, _1, _2));
+  REGISTER_SYNC("BluetoothSocket_close",
+      std::bind(&BluetoothSocket::Close, &bluetooth_socket, _1, _2));
 
   // other
-  RegisterSyncHandler("Bluetooth_checkPrivilege", CheckPrivilege);
+  REGISTER_SYNC("Bluetooth_checkPrivilege", CheckPrivilege);
+
+  #undef REGISTER_ASYNC
+  #undef REGISTER_SYNC
 }
 
 BluetoothInstance::~BluetoothInstance()
index 491836d..8cad56e 100644 (file)
@@ -22,7 +22,9 @@ namespace {
 }  // namespace
 
 BookmarkInstance::BookmarkInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&BookmarkInstance::x, this, _1, _2));
   REGISTER_SYNC("Bookmark_get", BookmarkGet);
index 2193d03..f78145a 100644 (file)
@@ -27,7 +27,9 @@ CalendarInstance& CalendarInstance::GetInstance() {
 }
 
 CalendarInstance::CalendarInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(c, std::bind(&CalendarInstance::x, this, _1, _2));
 
@@ -47,7 +49,7 @@ CalendarInstance::CalendarInstance() {
 #undef REGISTER_SYNC
 
 #define REGISTER_ASYNC(c, x) \
-  RegisterHandler(c, std::bind(&CalendarInstance::x, this, _1, _2));
+  RegisterSyncHandler(c, std::bind(&CalendarInstance::x, this, _1, _2));
   REGISTER_ASYNC("Calendar_addBatch", CalendarAddBatch);
   REGISTER_ASYNC("Calendar_updateBatch", CalendarUpdateBatch);
   REGISTER_ASYNC("Calendar_removeBatch", CalendarRemoveBatch);
index 14ee5e3..a0417e3 100644 (file)
@@ -44,7 +44,8 @@ CalendarPlugin::CalendarPlugin() {
 CalendarPlugin::~CalendarPlugin() { manager_ = nullptr; }
 
 void CalendarPlugin::OnLoad() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
 
   dispatcher_.AddFunction(
       "CalendarManager_getCalendars",
index 77d5dca..2b024d4 100644 (file)
@@ -25,7 +25,9 @@ CallHistoryInstance& CallHistoryInstance::getInstance() {
 }
 
 CallHistoryInstance::CallHistoryInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&CallHistoryInstance::x, this, _1, _2));
   REGISTER_SYNC("CallHistory_remove", Remove);
@@ -33,7 +35,7 @@ CallHistoryInstance::CallHistoryInstance() {
   REGISTER_SYNC("CallHistory_removeChangeListener", RemoveChangeListener);
 #undef REGISTER_SYNC
 #define REGISTER_ASYNC(c,x) \
-    RegisterHandler(c, std::bind(&CallHistoryInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&CallHistoryInstance::x, this, _1, _2));
   REGISTER_ASYNC("CallHistory_find", Find);
   REGISTER_ASYNC("CallHistory_removeBatch", RemoveBatch);
   REGISTER_ASYNC("CallHistory_removeAll", RemoveAll);
index 3e95554..21049ff 100644 (file)
@@ -26,12 +26,13 @@ ContactInstance& ContactInstance::GetInstance() {
 int ContactInstance::current_state = 0;
 
 ContactInstance::ContactInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
 
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(c, std::bind(&ContactInstance::x, this, _1, _2));
 #define REGISTER_ASYNC(c, x) \
-  RegisterHandler(c, std::bind(&ContactInstance::x, this, _1, _2));
+  RegisterSyncHandler(c, std::bind(&ContactInstance::x, this, _1, _2));
 
   // Contact Manager
   REGISTER_ASYNC("ContactManager_getAddressBooks",
index ed6cf97..1c2972e 100755 (executable)
@@ -31,9 +31,12 @@ using namespace common;
 using namespace extension::content;
 
 ContentInstance::ContentInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
   #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&ContentInstance::x, this, _1, _2));
+
   REGISTER_SYNC("ContentManager_find", ContentManagerFind);
   REGISTER_SYNC("ContentManager_update", ContentManagerUpdate);
   REGISTER_SYNC("ContentManager_scanFile", ContentManagerScanfile);
@@ -49,11 +52,10 @@ ContentInstance::ContentInstance() {
   REGISTER_SYNC("ContentPlaylist_get", ContentManagerPlaylistGet);
   REGISTER_SYNC("ContentPlaylist_remove", ContentManagerPlaylistRemove);
   REGISTER_SYNC("ContentPlaylist_removeBatch", ContentManagerPlaylistRemovebatch);
-  REGISTER_SYNC("ContentPlaylist_setOrder", ContentManagerPlaylistSetorder);  
+  REGISTER_SYNC("ContentPlaylist_setOrder", ContentManagerPlaylistSetorder);
   REGISTER_SYNC("ContentPlaylist_move", ContentManagerPlaylistMove);
-  REGISTER_SYNC("ContentManager_getLyrics", ContentManagerAudioGetLyrics);  
+  REGISTER_SYNC("ContentManager_getLyrics", ContentManagerAudioGetLyrics);
 
-  //  
   #undef REGISTER_SYNC
 }
 
@@ -61,14 +63,14 @@ ContentInstance::~ContentInstance() {
   LoggerE("<<endterd>>");
 }
 
-static void ReplyAsync(ContentInstance* instance, ContentCallbacks cbfunc, 
+static void ReplyAsync(ContentInstance* instance, ContentCallbacks cbfunc,
                        double callbackId, bool isSuccess, picojson::object& param) {
   LoggerE("<<endterd>>");
   param["callbackId"] = picojson::value(static_cast<double>(callbackId));
   param["status"] = picojson::value(isSuccess ? "success" : "error");
-  
+
   picojson::value result = picojson::value(param);
-  
+
   instance->PostMessage(result.serialize().c_str());
 }
 
@@ -79,7 +81,7 @@ static gboolean CompletedCallback(const std::shared_ptr<ReplyCallbackData>& user
   reply["value"] = user_data->result;
   ReplyAsync(user_data->instance,user_data->cbType,user_data->callbackId,user_data->isSuccess,reply);
 
-  return false;  
+  return false;
 }
 
 static void* WorkThread(const std::shared_ptr<ReplyCallbackData>& user_data) {
@@ -96,7 +98,7 @@ static void* WorkThread(const std::shared_ptr<ReplyCallbackData>& user_data) {
       break;
     }
     case ContentManagerFindCallback: {
-      ContentManager::getInstance()->find(user_data);        
+      ContentManager::getInstance()->find(user_data);
       break;
     }
     case ContentManagerScanfileCallback: {
@@ -165,14 +167,14 @@ static void* WorkThread(const std::shared_ptr<ReplyCallbackData>& user_data) {
   return NULL;
 }
 
-static void changedContentCallback(media_content_error_e error, int pid, media_content_db_update_item_type_e update_item, 
-  media_content_db_update_type_e update_type, media_content_type_e media_type, 
+static void changedContentCallback(media_content_error_e error, int pid, media_content_db_update_item_type_e update_item,
+  media_content_db_update_type_e update_type, media_content_type_e media_type,
   char *uuid, char *path, char *mime_type, void* user_data) {
 
   int ret;
   ReplyCallbackData *cbData = static_cast<ReplyCallbackData*>(user_data);
   picojson::object reply;
-  
+
   picojson::object o;
   if( error == MEDIA_CONTENT_ERROR_NONE) {
     if( update_item == MEDIA_ITEM_FILE) {
@@ -229,12 +231,12 @@ void ContentInstance::ContentManagerUpdate(const picojson::value& args, picojson
 void ContentInstance::ContentManagerUpdatebatch(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
-  
+
   if(ContentManager::getInstance()->isConnected()) {
     cbData->cbType = ContentManagerUpdatebatchCallback;
   }
@@ -266,7 +268,7 @@ void ContentInstance::ContentManagerFind(const picojson::value& args, picojson::
   CHECK_EXIST(args, "callbackId", out)
 
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
@@ -305,7 +307,7 @@ void ContentInstance::ContentManagerSetchangelistener(const picojson::value& arg
 //  std::shared_ptr<ReplyCallbackData>cbData(new ReplyCallbackData);
 
   ReplyCallbackData *cbData = new ReplyCallbackData();
-  
+
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
@@ -331,7 +333,7 @@ void ContentInstance::ContentManagerGetplaylists(const picojson::value& args, pi
 
   // implement it
   std::shared_ptr<ReplyCallbackData>cbData(new ReplyCallbackData);
-  
+
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
@@ -343,7 +345,7 @@ void ContentInstance::ContentManagerGetplaylists(const picojson::value& args, pi
   }
 
   common::TaskQueue::GetInstance().Queue<ReplyCallbackData>(WorkThread, CompletedCallback, cbData);
-  
+
 }
 void ContentInstance::ContentManagerCreateplaylist(const picojson::value& args, picojson::object& out) {
   CHECK_EXIST(args, "callbackId", out)
@@ -398,18 +400,18 @@ void ContentInstance::ContentManagerPlaylistAdd(const picojson::value& args, pic
   }
   else {
     ReportError(UnknownException("DB connection is failed."),out);
-  }  
+  }
 }
 
 void ContentInstance::ContentManagerPlaylistAddbatch(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
-  
+
   if(ContentManager::getInstance()->isConnected()) {
     cbData->cbType = ContentManagerPlaylistAddbatchCallback;
   }
@@ -423,12 +425,12 @@ void ContentInstance::ContentManagerPlaylistAddbatch(const picojson::value& args
 void ContentInstance::ContentManagerPlaylistGet(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
-  
+
   if(ContentManager::getInstance()->isConnected()) {
     cbData->cbType = ContentManagerPlaylistGetCallback;
   }
@@ -450,18 +452,18 @@ void ContentInstance::ContentManagerPlaylistRemove(const picojson::value& args,
   }
   else {
     ReportError(UnknownException("DB connection is failed."),out);
-  }  
+  }
 }
 
 void ContentInstance::ContentManagerPlaylistRemovebatch(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
-  
+
   if(ContentManager::getInstance()->isConnected()) {
     cbData->cbType = ContentManagerPlaylistRemovebatchCallback;
   }
@@ -475,12 +477,12 @@ void ContentInstance::ContentManagerPlaylistRemovebatch(const picojson::value& a
 void ContentInstance::ContentManagerPlaylistSetorder(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
   cbData->args = args;
-  
+
   if(ContentManager::getInstance()->isConnected()) {
     cbData->cbType = ContentManagerPlaylistSetOrderCallback;
   }
@@ -493,7 +495,7 @@ void ContentInstance::ContentManagerPlaylistSetorder(const picojson::value& args
 void ContentInstance::ContentManagerPlaylistMove(const picojson::value& args, picojson::object& out) {
   LoggerE("entered");
   double callbackId = args.get("callbackId").get<double>();
-  
+
   auto cbData = std::shared_ptr<ReplyCallbackData>(new ReplyCallbackData);
   cbData->callbackId = callbackId;
   cbData->instance = this;
@@ -505,7 +507,7 @@ void ContentInstance::ContentManagerPlaylistMove(const picojson::value& args, pi
   else {
     cbData->cbType = ContentManagerErrorCallback;
   }
-  common::TaskQueue::GetInstance().Queue<ReplyCallbackData>(WorkThread, CompletedCallback, cbData);  
+  common::TaskQueue::GetInstance().Queue<ReplyCallbackData>(WorkThread, CompletedCallback, cbData);
 }
 
 void ContentInstance::ContentManagerAudioGetLyrics(const picojson::value& args, picojson::object& out) {
index 3921cbf..9fcf533 100644 (file)
@@ -28,8 +28,10 @@ using common::PlatformResult;
 using common::ErrorCode;
 
 ExifInstance::ExifInstance() {
-  using namespace std::placeholders;
-#define REGISTER_ASYNC(c, x) RegisterHandler(c, std::bind(&ExifInstance::x, this, _1, _2));
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
+#define REGISTER_ASYNC(c, x) RegisterSyncHandler(c, std::bind(&ExifInstance::x, this, _1, _2));
   REGISTER_ASYNC("ExifManager_getExifInfo", ExifManagerGetExifInfo);
   REGISTER_ASYNC("ExifManager_saveExifInfo", ExifManagerSaveExifInfo);
   REGISTER_ASYNC("ExifManager_getThumbnail", ExifManagerGetThumbnail);
index c54be7d..345cc5f 100644 (file)
@@ -25,11 +25,14 @@ using namespace common;
 using namespace extension::filesystem;
 
 FilesystemInstance::FilesystemInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(c, std::bind(&FilesystemInstance::x, this, _1, _2));
 #define REGISTER_ASYNC(c, x) \
-  RegisterHandler(c, std::bind(&FilesystemInstance::x, this, _1, _2));
+  RegisterSyncHandler(c, std::bind(&FilesystemInstance::x, this, _1, _2));
+
   REGISTER_ASYNC("File_stat", FileStat);
   REGISTER_SYNC("File_statSync", FileStatSync);
   REGISTER_SYNC("File_createSync", FileCreateSync);
index 7ce5108..405f468 100644 (file)
@@ -126,9 +126,10 @@ MessagingInstance& MessagingInstance::getInstance()
 MessagingInstance::MessagingInstance()
 {
     LoggerD("Entered");
-    using namespace std::placeholders;
+    using std::placeholders::_1;
+    using std::placeholders::_2;
     #define REGISTER_ASYNC(c,x) \
-      RegisterHandler(c, std::bind(&MessagingInstance::x, this, _1, _2));
+      RegisterSyncHandler(c, std::bind(&MessagingInstance::x, this, _1, _2));
       REGISTER_ASYNC(FUN_GET_MESSAGE_SERVICES, GetMessageServices);
       REGISTER_ASYNC(FUN_MESSAGE_SERVICE_SEND_MESSAGE, MessageServiceSendMessage);
       REGISTER_ASYNC(FUN_MESSAGE_SERVICE_LOAD_MESSAGE_BODY, MessageServiceLoadMessageBody);
index 4ac386f..6925f3a 100644 (file)
@@ -24,12 +24,14 @@ using namespace common;
 using namespace extension::networkbearerselection;
 
 NetworkBearerSelectionInstance::NetworkBearerSelectionInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(      \
       c, std::bind(&NetworkBearerSelectionInstance::x, this, _1, _2));
 #define REGISTER_ASYNC(c, x) \
-  RegisterHandler(           \
+  RegisterSyncHandler(           \
       c, std::bind(&NetworkBearerSelectionInstance::x, this, _1, _2));
   REGISTER_SYNC("NetworkBearerSelection_requestRouteToHost",
                 NetworkBearerSelectionRequestRouteToHost);
index 8ca357f..2d7ac86 100644 (file)
@@ -26,7 +26,9 @@ NFCInstance& NFCInstance::getInstance() {
 }
 
 NFCInstance::NFCInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&NFCInstance::x, this, _1, _2));
   REGISTER_SYNC("NFCManager_getDefaultAdapter", GetDefaultAdapter);
@@ -74,7 +76,7 @@ NFCInstance::NFCInstance() {
   REGISTER_SYNC("NFCTag_isConnectedGetter", TagIsConnectedGetter);
 #undef REGISTER_SYNC
 #define REGISTER(c,x) \
-    RegisterHandler(c, std::bind(&NFCInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&NFCInstance::x, this, _1, _2));
   REGISTER("NFCAdapter_setPowered", SetPowered);
   REGISTER("NFCTag_readNDEF", ReadNDEF);
   REGISTER("NFCTag_writeNDEF", WriteNDEF);
index 271990d..5d0f188 100755 (executable)
@@ -41,7 +41,9 @@ using namespace common;
 using namespace extension::power;
 
 PowerInstance::PowerInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
   #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&PowerInstance::x, this, _1, _2));
   REGISTER_SYNC("PowerManager_turnScreenOff", PowerManagerTurnscreenoff);
@@ -61,23 +63,23 @@ PowerInstance::~PowerInstance() {
 }
 
 enum PowerCallbacks {
-  PowerManagerTurnscreenoffCallback, 
-  PowerManagerRestorescreenbrightnessCallback, 
-  PowerManagerRequestCallback, 
-  PowerManagerGetscreenbrightnessCallback, 
-  PowerManagerReleaseCallback, 
-  PowerManagerUnsetscreenstatechangelistenerCallback, 
-  PowerManagerIsscreenonCallback, 
-  PowerManagerTurnscreenonCallback, 
-  PowerManagerSetscreenbrightnessCallback, 
+  PowerManagerTurnscreenoffCallback,
+  PowerManagerRestorescreenbrightnessCallback,
+  PowerManagerRequestCallback,
+  PowerManagerGetscreenbrightnessCallback,
+  PowerManagerReleaseCallback,
+  PowerManagerUnsetscreenstatechangelistenerCallback,
+  PowerManagerIsscreenonCallback,
+  PowerManagerTurnscreenonCallback,
+  PowerManagerSetscreenbrightnessCallback,
   PowerManagerSetscreenstatechangelistenerCallback
 };
 
-static void ReplyAsync(PowerInstance* instance, PowerCallbacks cbfunc, 
+static void ReplyAsync(PowerInstance* instance, PowerCallbacks cbfunc,
                        int callbackId, bool isSuccess, picojson::object& param) {
   param["callbackId"] = picojson::value(static_cast<double>(callbackId));
   param["status"] = picojson::value(isSuccess ? "success" : "error");
-  
+
   // insert result for async callback to param
   switch(cbfunc) {
     case PowerManagerRequestCallback: {
@@ -127,7 +129,7 @@ static void ReplyAsync(PowerInstance* instance, PowerCallbacks cbfunc,
   }
 
   picojson::value result = picojson::value(param);
-  
+
   instance->PostMessage(result.serialize().c_str());
 }
 
@@ -136,7 +138,7 @@ static void ReplyAsync(PowerInstance* instance, PowerCallbacks cbfunc,
       ReportError(TypeMismatchException(name" is required argument"), out);\
       return;\
     }
-    
+
 void PowerInstance::PowerManagerRequest(const picojson::value& args, picojson::object& out) {
   const std::string& resource = args.get("resource").get<std::string>();
   const std::string& state = args.get("state").get<std::string>();
index a2c9101..5b1821a 100644 (file)
 namespace extension {
 namespace push {
 
-PushInstance::PushInstance():
-        m_ignoreNotificationEvents(true) {
+PushInstance::PushInstance(): m_ignoreNotificationEvents(true) {
     LoggerD("Enter");
     using std::placeholders::_1;
     using std::placeholders::_2;
-    RegisterHandler("Push_registerService",
-            std::bind(&PushInstance::registerService, this, _1, _2));
-    RegisterHandler("Push_unregisterService",
-            std::bind(&PushInstance::unregisterService, this, _1, _2));
-    RegisterSyncHandler("Push_connectService",
-            std::bind(&PushInstance::connectService, this, _1, _2));
-    RegisterSyncHandler("Push_disconnectService",
-            std::bind(&PushInstance::disconnectService, this, _1, _2));
-    RegisterSyncHandler("Push_getRegistrationId",
-            std::bind(&PushInstance::getRegistrationId, this, _1, _2));
-    RegisterSyncHandler("Push_getUnreadNotifications",
-            std::bind(&PushInstance::getUnreadNotifications, this, _1, _2));
+
+    #define REGISTER_ASYNC(c, func) \
+        RegisterSyncHandler(c, func);
+    #define REGISTER_SYNC(c, func) \
+        RegisterSyncHandler(c, func);
+
+    REGISTER_ASYNC("Push_registerService",
+        std::bind(&PushInstance::registerService, this, _1, _2));
+    REGISTER_ASYNC("Push_unregisterService",
+        std::bind(&PushInstance::unregisterService, this, _1, _2));
+    REGISTER_SYNC("Push_connectService",
+        std::bind(&PushInstance::connectService, this, _1, _2));
+    REGISTER_SYNC("Push_disconnectService",
+        std::bind(&PushInstance::disconnectService, this, _1, _2));
+    REGISTER_SYNC("Push_getRegistrationId",
+        std::bind(&PushInstance::getRegistrationId, this, _1, _2));
+    REGISTER_SYNC("Push_getUnreadNotifications",
+        std::bind(&PushInstance::getUnreadNotifications, this, _1, _2));
     PushManager::getInstance().setListener(this);
+
+    #undef REGISTER_ASYNC
+    #undef REGISTER_SYNC
 }
 
 void PushInstance::registerService(const picojson::value& args,
index 8404e44..cd282e6 100644 (file)
@@ -19,9 +19,12 @@ using namespace common;
 using namespace extension::radio;
 
 RadioInstance::RadioInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
   #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&RadioInstance::x, this, _1, _2));
+
   REGISTER_SYNC("FMRadio_Start", Start);
   REGISTER_SYNC("FMRadio_Stop", Stop);
   REGISTER_SYNC("FMRadio_SetFMRadioInterruptedListener", SetFMRadioInterruptedListener);
@@ -36,7 +39,7 @@ RadioInstance::RadioInstance() {
   REGISTER_SYNC("FMRadio_MuteGetter", MuteGetter);
   #undef REGISTER_SYNC
   #define REGISTER_ASYNC(c,x) \
-    RegisterHandler(c, std::bind(&RadioInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&RadioInstance::x, this, _1, _2));
   REGISTER_ASYNC("FMRadio_SeekUp", SeekUp);
   REGISTER_ASYNC("FMRadio_SeekDown", SeekDown);
   REGISTER_ASYNC("FMRadio_ScanStart", ScanStart);
index 585f91d..f19b664 100644 (file)
@@ -26,7 +26,8 @@ SecureElementInstance& SecureElementInstance::getInstance() {
 }
 
 SecureElementInstance::SecureElementInstance() {
-    using namespace std::placeholders;
+    using std::placeholders::_1;
+    using std::placeholders::_2;
 
 #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&SecureElementInstance::x, this, _1, _2));
@@ -46,7 +47,7 @@ SecureElementInstance::SecureElementInstance() {
 #undef REGISTER_SYNC
 
 #define REGISTER(c,x) \
-    RegisterHandler(c, std::bind(&SecureElementInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&SecureElementInstance::x, this, _1, _2));
 
     REGISTER("SEService_getReaders", GetReaders);
     REGISTER("SEReader_openSession", OpenSession);
index 6914c3d..4e991db 100644 (file)
@@ -20,7 +20,9 @@ SensorInstance& SensorInstance::GetInstance() {
 }
 
 SensorInstance::SensorInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&SensorInstance::x, this, _1, _2));
   REGISTER_SYNC("SensorService_getAvailableSensors", GetAvailableSensors);
@@ -29,7 +31,7 @@ SensorInstance::SensorInstance() {
   REGISTER_SYNC("Sensor_unsetChangeListener", SensorUnsetChangeListener);
 #undef REGISTER_SYNC
 #define REGISTER_ASYNC(c,x) \
-    RegisterHandler(c, std::bind(&SensorInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&SensorInstance::x, this, _1, _2));
   REGISTER_ASYNC("Sensor_start", SensorStart);
   REGISTER_ASYNC("Sensor_getData", SensorGetData);
 #undef REGISTER_ASYNC
index 5a6e78e..b4d5020 100644 (file)
@@ -24,7 +24,9 @@ using namespace common;
 using namespace extension::sound;
 
 SoundInstance::SoundInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
   #define REGISTER_SYNC(c,x) \
     RegisterSyncHandler(c, std::bind(&SoundInstance::x, this, _1, _2));
   REGISTER_SYNC("SoundManager_setVolume", SoundManagerSetVolume);
index a994b02..333f772 100644 (file)
@@ -106,7 +106,9 @@ SysteminfoInstance& SysteminfoInstance::getInstance() {
 }
 
 SysteminfoInstance::SysteminfoInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
 #define REGISTER_SYNC(c,x) \
         RegisterSyncHandler(c, std::bind(&SysteminfoInstance::x, this, _1, _2));
   REGISTER_SYNC("SystemInfo_getCapabilities", GetCapabilities);
@@ -118,7 +120,7 @@ SysteminfoInstance::SysteminfoInstance() {
   REGISTER_SYNC("SystemInfo_getCount", GetCount);
 #undef REGISTER_SYNC
 #define REGISTER_ASYNC(c,x) \
-        RegisterHandler(c, std::bind(&SysteminfoInstance::x, this, _1, _2));
+        RegisterSyncHandler(c, std::bind(&SysteminfoInstance::x, this, _1, _2));
   REGISTER_ASYNC("SystemInfo_getPropertyValue", GetPropertyValue);
   REGISTER_ASYNC("SystemInfo_getPropertyValueArray", GetPropertyValueArray);
 #undef REGISTER_ASYNC
index 197ce0d..c16fbb8 100644 (file)
@@ -28,10 +28,11 @@ using namespace extension::systemsetting;
 
 SystemSettingInstance::SystemSettingInstance()
 {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
 
 #define REGISTER(c,x) \
-    RegisterHandler(c, std::bind(&SystemSettingInstance::x, this, _1, _2));
+    RegisterSyncHandler(c, std::bind(&SystemSettingInstance::x, this, _1, _2));
 
   REGISTER("SystemSettingManager_getProperty", getProperty);
   REGISTER("SystemSettingManager_setProperty", setProperty);
index b9af7c4..d25bf71 100644 (file)
@@ -50,12 +50,13 @@ TimeInstance& TimeInstance::GetInstance() {
 }
 
 TimeInstance::TimeInstance() {
-  using namespace std::placeholders;
+  using std::placeholders::_1;
+  using std::placeholders::_2;
 
 #define REGISTER_SYNC(c, x) \
   RegisterSyncHandler(c, std::bind(&TimeInstance::x, this, _1, _2));
 #define REGISTER_ASYNC(c, x) \
-  RegisterHandler(c, std::bind(&TimeInstance::x, this, _1, _2));
+  RegisterSyncHandler(c, std::bind(&TimeInstance::x, this, _1, _2));
 
   REGISTER_SYNC("Time_getAvailableTimeZones", TimeGetAvailableTimeZones);
   REGISTER_SYNC("Time_getDSTTransition", TimeGetDSTTransition);
index 797ee21..1158e92 100644 (file)
@@ -18,34 +18,33 @@ namespace tvchannel {
 using common::TaskQueue;
 
 TVChannelInstance::TVChannelInstance() {
-    LOGD("Entered");
-    RegisterSyncHandler("TVChannelManager_getCurrentChannel",
-        std::bind(&TVChannelInstance::getCurrentChannel, this,
-            std::placeholders::_1, std::placeholders::_2));
-    RegisterSyncHandler("TVChannelManager_getCurrentProgram",
-        std::bind(&TVChannelInstance::getCurrentProgram, this,
-            std::placeholders::_1, std::placeholders::_2));
-    RegisterHandler("TVChannelManager_findChannel",
-        std::bind(&TVChannelInstance::findChannel, this,
-            std::placeholders::_1,
-            std::placeholders::_2));
-    RegisterHandler("TVChannelManager_getChannelList",
-        std::bind(&TVChannelInstance::getChannelList, this,
-            std::placeholders::_1,
-            std::placeholders::_2));
-    RegisterHandler("TVChannelManager_getProgramList",
-        std::bind(&TVChannelInstance::getProgramList, this,
-            std::placeholders::_1,
-            std::placeholders::_2));
-    RegisterHandler("TVChannelManager_tune",
-        std::bind(&TVChannelInstance::tune, this, std::placeholders::_1,
-            std::placeholders::_2));
-    RegisterHandler("TVChannelManager_tuneUp",
-        std::bind(&TVChannelInstance::tuneUp, this, std::placeholders::_1,
-            std::placeholders::_2));
-    RegisterHandler("TVChannelManager_tuneDown",
-        std::bind(&TVChannelInstance::tuneDown, this, std::placeholders::_1,
-            std::placeholders::_2));
+    using std::placeholders::_1;
+    using std::placeholders::_2;
+
+    #define REGISTER_ASYNC(c, func) \
+        RegisterSyncHandler(c, func);
+    #define REGISTER_SYNC(c, func) \
+        RegisterSyncHandler(c, func);
+
+    REGISTER_SYNC("TVChannelManager_getCurrentChannel",
+        std::bind(&TVChannelInstance::getCurrentChannel, this, _1, _2));
+    REGISTER_SYNC("TVChannelManager_getCurrentProgram",
+        std::bind(&TVChannelInstance::getCurrentProgram, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_findChannel",
+        std::bind(&TVChannelInstance::findChannel, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_getChannelList",
+        std::bind(&TVChannelInstance::getChannelList, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_getProgramList",
+        std::bind(&TVChannelInstance::getProgramList, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_tune",
+        std::bind(&TVChannelInstance::tune, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_tuneUp",
+        std::bind(&TVChannelInstance::tuneUp, this, _1, _2));
+    REGISTER_ASYNC("TVChannelManager_tuneDown",
+        std::bind(&TVChannelInstance::tuneDown, this, _1, _2));
+
+    #undef REGISTER_ASYNC
+    #undef REGISTER_SYNC
 
     m_pSubscriber = TVChannelManager::getInstance()->createSubscriber(this);
     TVChannelManager::getInstance()->registerListener(m_pSubscriber);
index e9cab15..6e285e2 100644 (file)
@@ -69,18 +69,22 @@ namespace tvdisplay {
 TVDisplayInstance::TVDisplayInstance() {
     using std::placeholders::_1;
     using std::placeholders::_2;
-    RegisterSyncHandler(
-        "TVDisplay_is3DModeEnabled",
-        std::bind(&TVDisplayInstance::Is3DModeEnabled,
-                this, _1, _2));
-    RegisterSyncHandler(
-        "TVDisplay_get3DEffectMode",
-        std::bind(&TVDisplayInstance::Get3DEffectMode,
-                this, _1, _2));
-    RegisterHandler(
-        "TVDisplay_getSupported3DEffectModeList",
+
+    #define REGISTER_ASYNC(c, func) \
+        RegisterSyncHandler(c, func);
+    #define REGISTER_SYNC(c, func) \
+        RegisterSyncHandler(c, func);
+
+    REGISTER_SYNC("TVDisplay_is3DModeEnabled",
+        std::bind(&TVDisplayInstance::Is3DModeEnabled, this, _1, _2));
+    REGISTER_SYNC("TVDisplay_get3DEffectMode",
+        std::bind(&TVDisplayInstance::Get3DEffectMode,this, _1, _2));
+    REGISTER_ASYNC("TVDisplay_getSupported3DEffectModeList",
         std::bind(&TVDisplayInstance::GetSupported3DEffectModeList,
-                this, _1, _2));
+                  this, _1, _2));
+
+    #undef REGISTER_ASYNC
+    #undef REGISTER_SYNC
 }
 
 TVDisplayInstance::~TVDisplayInstance() {}
index 7fa7af7..229d711 100644 (file)
@@ -32,14 +32,18 @@ typedef std::string JsonString;
 
 WebSettingInstance::WebSettingInstance(WebSettingExtension* extension)
     : extension_(extension) {
-  using namespace std::placeholders;
-#define REGISTER_ASYNC(c, x) \
-  RegisterHandler(c, std::bind(&WebSettingInstance::x, this, _1, _2));
+  using std::placeholders::_1;
+  using std::placeholders::_2;
+
+  #define REGISTER_ASYNC(c, x) \
+      RegisterSyncHandler(c, std::bind(&WebSettingInstance::x, this, _1, _2));
+
   REGISTER_ASYNC("WebSettingManager_setUserAgentString",
                  WebSettingManagerSetUserAgentString);
   REGISTER_ASYNC("WebSettingManager_removeAllCookies",
                  WebSettingManagerRemoveAllCookies);
-#undef REGISTER_ASYNC
+
+  #undef REGISTER_ASYNC
 }
 
 WebSettingInstance::~WebSettingInstance() {}