[M108 Aura Migration][NaCl][PPFwk] Add error logs + SVACE/DLOG/Static analysis fix
[platform/framework/web/chromium-efl.git] / ppapi / proxy / graphics_2d_resource.cc
index 511fbef..66339d5 100644 (file)
@@ -5,6 +5,7 @@
 #include "ppapi/proxy/graphics_2d_resource.h"
 
 #include "base/bind.h"
+#include "base/logging.h"
 #include "ppapi/c/pp_bool.h"
 #include "ppapi/c/pp_point.h"
 #include "ppapi/c/pp_rect.h"
@@ -131,11 +132,15 @@ PP_Bool Graphics2DResource::SetLayerTransform(float scale,
 int32_t Graphics2DResource::Flush(scoped_refptr<TrackedCallback> callback) {
   // If host is not even created, return failure immediately.  This can happen
   // when failed to initialize (in constructor).
-  if (!sent_create_to_renderer())
+  if (!sent_create_to_renderer()) {
+    LOG(ERROR) << "Failed to initialize - host not created";
     return PP_ERROR_FAILED;
+  }
 
-  if (TrackedCallback::IsPending(current_flush_callback_))
+  if (TrackedCallback::IsPending(current_flush_callback_)) {
+    LOG(ERROR) << "Flush is pending";
     return PP_ERROR_INPROGRESS;  // Can't have >1 flush pending.
+  }
   current_flush_callback_ = callback;
 
   Call<PpapiPluginMsg_Graphics2D_FlushAck>(