[M108 Aura Migration][NaCl][PPFwk] Add error logs + SVACE/DLOG/Static analysis fix
[platform/framework/web/chromium-efl.git] / ppapi / proxy / network_list_resource.cc
index 3d288f3..be9e3ed 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <algorithm>
 
+#include "base/logging.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/shared_impl/array_writer.h"
 #include "ppapi/shared_impl/var.h"
@@ -53,12 +54,17 @@ PP_NetworkList_State NetworkListResource::GetState(uint32_t index) {
 int32_t NetworkListResource::GetIpAddresses(uint32_t index,
                                             const PP_ArrayOutput& output) {
   ArrayWriter writer(output);
-  if (index >= list_.size() || !writer.is_valid())
+  if (index >= list_.size() || !writer.is_valid()) {
+    LOG(ERROR) << "Index is larger than list size or output array is invalid, "
+               << "index = " << index << ", list size = " << list_.size();
     return PP_ERROR_BADARGUMENT;
+  }
 
   thunk::EnterResourceCreationNoLock enter(pp_instance());
-  if (enter.failed())
+  if (enter.failed()) {
+    LOG(ERROR) << "Enter pp_instance failed";
     return PP_ERROR_FAILED;
+  }
 
   const std::vector<PP_NetAddress_Private>& addresses =
       list_.at(index).addresses;
@@ -68,8 +74,10 @@ int32_t NetworkListResource::GetIpAddresses(uint32_t index,
         enter.functions()->CreateNetAddressFromNetAddressPrivate(
             pp_instance(), addresses[i]));
   }
-  if (!writer.StoreResourceVector(addr_resources))
+  if (!writer.StoreResourceVector(addr_resources)) {
+    LOG(ERROR) << "Writer cannot store given resource vector";
     return PP_ERROR_FAILED;
+  }
 
   return PP_OK;
 }