"PPB_URLLoader.Open: invalid request resource ID. (Hint to C++ wrapper"
" users: use the ResourceRequest constructor that takes an instance or"
" else the request will be null.)");
+ LOG(ERROR) << "Enter URLRequestInfo failed";
return PP_ERROR_BADARGUMENT;
}
return Open(enter_request.object()->GetData(), 0, callback);
int32_t rv = ValidateCallback(callback);
if (rv != PP_OK)
return rv;
- if (mode_ != MODE_WAITING_TO_OPEN)
+ if (mode_ != MODE_WAITING_TO_OPEN) {
+ LOG(ERROR) << "URLLoader already opened";
return PP_ERROR_INPROGRESS;
+ }
request_data_ = request_data;
int32_t rv = ValidateCallback(callback);
if (rv != PP_OK)
return rv;
- if (mode_ != MODE_OPENING)
+ if (mode_ != MODE_OPENING) {
+ LOG(ERROR) << "URLLoader already opened";
return PP_ERROR_INPROGRESS;
+ }
SetDefersLoading(false); // Allow the redirect to continue.
RegisterCallback(callback);
int32_t rv = ValidateCallback(callback);
if (rv != PP_OK)
return rv;
- if (!response_info_.get())
+ if (!response_info_.get()) {
+ LOG(ERROR) << "Cannot get response info";
return PP_ERROR_FAILED;
+ }
- if (bytes_to_read <= 0 || !buffer)
+ if (bytes_to_read <= 0 || !buffer) {
+ LOG(ERROR) << "Buffer is " << buffer
+ << ", bytes to read = " << bytes_to_read;
return PP_ERROR_BADARGUMENT;
+ }
user_buffer_ = static_cast<char*>(buffer);
user_buffer_size_ = bytes_to_read;
int32_t URLLoaderResource::ValidateCallback(
scoped_refptr<TrackedCallback> callback) {
DCHECK(callback.get());
- if (TrackedCallback::IsPending(pending_callback_))
+ if (TrackedCallback::IsPending(pending_callback_)) {
+ LOG(ERROR) << "Validate is pending";
return PP_ERROR_INPROGRESS;
+ }
return PP_OK;
}