Cleanup code to remove warning messages at buildtime.
authorWonYoung Choi <wy80.choi@samsung.com>
Tue, 28 Apr 2015 12:55:16 +0000 (21:55 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Tue, 28 Apr 2015 12:55:16 +0000 (21:55 +0900)
Change-Id: Ibf101ab759b4a59c3abfacea48318bdc89b78998

13 files changed:
src/bundle/extension_client.cc
src/bundle/extension_module.cc
src/bundle/injected_bundle.cc
src/bundle/module_system.cc
src/common/file_utils.cc
src/common/string_utils.cc
src/extension/extension_server.cc
src/runtime/native_app_window.cc
src/runtime/native_window.cc
src/runtime/resource_manager.cc
src/runtime/runtime.cc
src/runtime/web_application.cc
src/runtime/web_view_impl.cc

index 726db8e..c0d0744 100755 (executable)
@@ -68,7 +68,7 @@ void ExtensionClient::DestroyInstance(const std::string& instance_id) {
 
 void ExtensionClient::PostMessageToNative(
     const std::string& instance_id, const std::string& msg) {
-  GVariant* value = dbus_extension_client_.Call(
+  dbus_extension_client_.Call(
       kDBusInterfaceNameForExtension, kMethodPostMessage,
       g_variant_new("(ss)", instance_id.c_str(), msg.c_str()),
       NULL);
index a00d383..c316ef0 100644 (file)
@@ -317,7 +317,6 @@ void ExtensionModule::PostMessageCallback(
     return;
   }
 
-  v8::Handle<v8::Context> context = info.GetIsolate()->GetCurrentContext();
   v8::String::Utf8Value value(info[0]->ToString());
 
   // CHECK(module->instance_id_);
@@ -336,7 +335,6 @@ void ExtensionModule::SendSyncMessageCallback(
     return;
   }
 
-  v8::Handle<v8::Context> context = info.GetIsolate()->GetCurrentContext();
   v8::String::Utf8Value value(info[0]->ToString());
 
   // CHECK(module->instance_id_);
index 95af893..c977972 100644 (file)
@@ -9,28 +9,28 @@
 #include "common/logger.h"
 #include "bundle/extension_renderer_controller.h"
 
-extern "C" void DynamicSetWidgetInfo(int widget_id) {
+extern "C" void DynamicSetWidgetInfo(int /*widget_id*/) {
   LoggerD("InjectedBundle::DynamicSetWidgetInfo !!");
 }
 
-extern "C" void DynamicPluginStartSession(int widget_id,
+extern "C" void DynamicPluginStartSession(int /*widget_id*/,
                                           v8::Handle<v8::Context> context,
-                                          int routing_handle,
-                                          double scale,
-                                          const char* encoded_bundle,
-                                          const char* theme,
-                                          const char* base_url) {
+                                          int /*routing_handle*/,
+                                          double /*scale*/,
+                                          const char* uuid,
+                                          const char* /*theme*/,
+                                          const char* /*base_url*/) {
   LoggerD("InjectedBundle::DynamicPluginStartSession !!");
 
   wrt::ExtensionRendererController& controller =
       wrt::ExtensionRendererController::GetInstance();
   // TODO(wy80.choi): Temporarily, uuid is passed as theme arguments.
-  controller.InitializeExtensions(theme);
+  controller.InitializeExtensions(uuid);
   controller.DidCreateScriptContext(context);
 }
 
 extern "C" void DynamicPluginStopSession(
-    int widget_id, v8::Handle<v8::Context> context) {
+    int /*widget_id*/, v8::Handle<v8::Context> context) {
   LoggerD("InjectedBundle::DynamicPluginStopSession !!");
 
   wrt::ExtensionRendererController& controller =
@@ -39,15 +39,16 @@ extern "C" void DynamicPluginStopSession(
 }
 
 extern "C" void DynamicUrlParsing(
-    std::string* old_url, std::string* new_url, int widget_id) {
+    std::string* old_url, std::string* new_url, int /*widget_id*/) {
   LoggerD("InjectedBundle::DynamicUrlParsing !!");
+  *new_url = *old_url;
 }
 
-extern "C" void DynamicDatabaseAttach(int attach) {
+extern "C" void DynamicDatabaseAttach(int /*attach*/) {
   LoggerD("InjectedBundle::DynamicDatabaseAttach !!");
 }
 
-extern "C" void DynamicOnIPCMessage(const Ewk_IPC_Wrt_Message_Data& data) {
+extern "C" void DynamicOnIPCMessage(const Ewk_IPC_Wrt_Message_Data& /*data*/) {
   LoggerD("InjectedBundle::DynamicOnIPCMessage !!");
 }
 
index 0880870..7849b5f 100644 (file)
@@ -25,23 +25,6 @@ const int kModuleSystemEmbedderDataIndex = 8;
 // pointer back to XWalkExtensionModule.
 const char* kWrtModuleSystem = "kWrtModuleSystem";
 
-ModuleSystem* GetModuleSystem(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  v8::Isolate* isolate = info.GetIsolate();
-  v8::HandleScope handle_scope(isolate);
-
-  v8::Handle<v8::Object> data = info.Data().As<v8::Object>();
-  v8::Handle<v8::Value> module_system =
-      data->Get(v8::String::NewFromUtf8(isolate, kWrtModuleSystem));
-  if (module_system.IsEmpty() || module_system->IsUndefined()) {
-    LoggerE("ModuleSystem is not defined.");
-    return NULL;
-  }
-
-  return static_cast<ModuleSystem*>(
-      module_system.As<v8::External>()->Value());
-}
-
 }  // namespace
 
 ModuleSystem::ModuleSystem(v8::Handle<v8::Context> context) {
index 831f291..d8c93b0 100644 (file)
@@ -26,7 +26,7 @@ std::string DirName(const std::string& path) {
 }
 
 std::string SchemeName(const std::string& uri) {
-  int pos = uri.find(":");
+  size_t pos = uri.find(":");
   if (pos != std::string::npos && pos < uri.length()) {
     return std::string(uri.substr(0, pos));
   } else {
index 3a2ba3b..620f663 100644 (file)
@@ -36,7 +36,7 @@ bool EndsWith(const std::string& str, const std::string& sub) {
 std::string ReplaceAll(const std::string& replace,
                        const std::string& from, const std::string& to) {
   std::string str = replace;
-  int pos = str.find(from);
+  size_t pos = str.find(from);
   while (pos != std::string::npos) {
     str.replace(pos, from.length(), to);
     pos = str.find(from, pos+to.length());
index 2a277c2..c725ade 100644 (file)
@@ -146,8 +146,8 @@ bool ExtensionServer::RegisterSymbols(Extension* extension) {
   return true;
 }
 
-void ExtensionServer::GetRuntimeVariable(const char* key, char* value,
-    size_t value_len) {
+void ExtensionServer::GetRuntimeVariable(const char* /*key*/, char* /*value*/,
+    size_t /*value_len*/) {
   // TODO(wy80.choi): DBus Call to Runtime to get runtime variable
 }
 
index 04aab7f..943dcaf 100755 (executable)
@@ -15,7 +15,7 @@ NativeAppWindow::~NativeAppWindow() {
 }
 
 Evas_Object* NativeAppWindow::CreateWindowInternal() {
-  elm_config_preferred_engine_set("opengl_x11");
+  elm_config_accel_preference_set("opengl");
   return elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC);
 }
 
index 9afe93f..c48df5c 100755 (executable)
@@ -140,7 +140,7 @@ void NativeWindow::DidDeleteRequested(void* /*data*/,
   elm_exit();
 }
 
-void NativeWindow::DidProfileChanged(void* data,
+void NativeWindow::DidProfileChanged(void* /*data*/,
     Evas_Object* /*obj*/, void* /*event_info*/) {
   LoggerD("didProfileChanged");
 }
index e62f22d..6880b99 100755 (executable)
@@ -29,9 +29,10 @@ typedef std::vector<AppControlInfo> AppControlList;
 // Scheme type
 const char* kSchemeTypeApp = "app://";
 const char* kSchemeTypeFile = "file://";
-const char* kSchemeTypeHttp = "http://";
-const char* kSchemeTypeHttps = "https://";
-const char* kSchemeTypeWidget = "widget://";
+// TODO(wy80.choi): comment out below unused const variables if needed.
+// const char* kSchemeTypeHttp = "http://";
+// const char* kSchemeTypeHttps = "https://";
+// const char* kSchemeTypeWidget = "widget://";
 
 // Default Start Files
 const char* kDefaultStartFiles[] = {
index 7e17a8f..e12a97b 100755 (executable)
@@ -126,7 +126,7 @@ void Runtime::OnAppControl(app_control_h app_control) {
   }
 }
 
-void Runtime::OnLanguageChanged(const std::string& language) {
+void Runtime::OnLanguageChanged(const std::string& /*language*/) {
   if (application_) {
     application_->OnLanguageChanged();
   }
@@ -138,10 +138,10 @@ void Runtime::OnLowMemory() {
   }
 }
 
-void Runtime::HandleDBusMethod(GDBusConnection* connection,
+void Runtime::HandleDBusMethod(GDBusConnection* /*connection*/,
                                const std::string& method_name,
-                               GVariant* parameters,
-                               GDBusMethodInvocation* invocation) {
+                               GVariant* /*parameters*/,
+                               GDBusMethodInvocation* /*invocation*/) {
   if (method_name == kMethodNotifyEPCreated) {
     // TODO(wy80.choi): send signal to injected bundle to make connection
     // between injected bundle and extension process
@@ -152,7 +152,7 @@ void Runtime::HandleDBusMethod(GDBusConnection* connection,
 }
 
 int Runtime::Exec(int argc, char* argv[]) {
-  ui_app_lifecycle_callback_s ops = {0, };
+  ui_app_lifecycle_callback_s ops = {NULL, NULL, NULL, NULL, NULL};
 
   // onCreate
   ops.create = [](void* data) -> bool {
index 8727788..02c292f 100755 (executable)
@@ -247,7 +247,7 @@ void WebApplication::Suspend() {
   }
 }
 
-void WebApplication::OnCreatedNewWebView(WebView* view, WebView* new_view) {
+void WebApplication::OnCreatedNewWebView(WebView* /*view*/, WebView* new_view) {
   if (view_stack_.size() > 0 && view_stack_.front() != NULL)
     view_stack_.front()->SetVisibility(false);
 
@@ -283,7 +283,7 @@ void WebApplication::OnClosedWebView(WebView * view) {
 
 void WebApplication::OnReceivedWrtMessage(
     WebView* /*view*/,
-    Ewk_IPC_Wrt_Message_Data* message) {
+    Ewk_IPC_Wrt_Message_Data* /*message*/) {
   // TODO(wy80.choi) : Handle messages from injected bundle?
   // ex. SendRuntimeMessage to hide / exit application.
 }
@@ -361,13 +361,13 @@ bool WebApplication::OnContextMenuDisabled(WebView* /*view*/) {
            true);
 }
 
-void WebApplication::OnLoadStart(WebView* view) {
+void WebApplication::OnLoadStart(WebView* /*view*/) {
   LoggerD("LoadStart");
 }
-void WebApplication::OnLoadFinished(WebView* view) {
+void WebApplication::OnLoadFinished(WebView* /*view*/) {
   LoggerD("LoadFinished");
 }
-void WebApplication::OnRendered(WebView* view) {
+void WebApplication::OnRendered(WebView* /*view*/) {
   LoggerD("Rendered");
 }
 
index 5592968..870fc93 100755 (executable)
@@ -342,7 +342,7 @@ void WebViewImpl::InitIPCMessageCallback() {
 
 void WebViewImpl::InitOrientaionLockCallback() {
   // Orientation lock callback
-  auto orientation_lock_callback = [](Evas_Object* o,
+  auto orientation_lock_callback = [](Evas_Object*,
                                       Eina_Bool need_lock,
                                       int orientation,
                                       void* user_data) -> Eina_Bool {