#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"
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>(