| Index: webkit/glue/plugins/pepper_url_request_info.cc
|
| ===================================================================
|
| --- webkit/glue/plugins/pepper_url_request_info.cc (revision 65116)
|
| +++ webkit/glue/plugins/pepper_url_request_info.cc (working copy)
|
| @@ -15,6 +15,7 @@
|
| #include "third_party/WebKit/WebKit/chromium/public/WebHTTPBody.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h"
|
| +#include "webkit/glue/plugins/pepper_common.h"
|
| #include "webkit/glue/plugins/pepper_file_ref.h"
|
| #include "webkit/glue/plugins/pepper_plugin_module.h"
|
| #include "webkit/glue/plugins/pepper_string.h"
|
| @@ -38,12 +39,12 @@
|
| "content-length"
|
| };
|
|
|
| -bool IsIgnoredRequestHeader(const std::string& name) {
|
| +PP_Bool IsIgnoredRequestHeader(const std::string& name) {
|
| for (size_t i = 0; i < arraysize(kIgnoredRequestHeaders); ++i) {
|
| if (LowerCaseEqualsASCII(name, kIgnoredRequestHeaders[i]))
|
| - return true;
|
| + return PP_TRUE;
|
| }
|
| - return false;
|
| + return PP_FALSE;
|
| }
|
|
|
| PP_Resource Create(PP_Module module_id) {
|
| @@ -56,40 +57,47 @@
|
| return request->GetReference();
|
| }
|
|
|
| -bool IsURLRequestInfo(PP_Resource resource) {
|
| - return !!Resource::GetAs<URLRequestInfo>(resource);
|
| +PP_Bool IsURLRequestInfo(PP_Resource resource) {
|
| + return BoolToPPBool(!!Resource::GetAs<URLRequestInfo>(resource));
|
| }
|
|
|
| -bool SetProperty(PP_Resource request_id,
|
| - PP_URLRequestProperty_Dev property,
|
| - PP_Var var) {
|
| +PP_Bool SetProperty(PP_Resource request_id,
|
| + PP_URLRequestProperty_Dev property,
|
| + PP_Var var) {
|
| scoped_refptr<URLRequestInfo> request(
|
| Resource::GetAs<URLRequestInfo>(request_id));
|
| if (!request)
|
| - return false;
|
| + return PP_FALSE;
|
|
|
| - if (var.type == PP_VARTYPE_BOOL)
|
| - return request->SetBooleanProperty(property, var.value.as_bool);
|
| + if (var.type == PP_VARTYPE_BOOL) {
|
| + return BoolToPPBool(
|
| + request->SetBooleanProperty(property,
|
| + PPBoolToBool(var.value.as_bool)));
|
| + }
|
|
|
| if (var.type == PP_VARTYPE_STRING) {
|
| scoped_refptr<StringVar> string(StringVar::FromPPVar(var));
|
| - if (string)
|
| - return request->SetStringProperty(property, string->value());
|
| + if (string) {
|
| + return BoolToPPBool(request->SetStringProperty(property,
|
| + string->value()));
|
| + }
|
| }
|
|
|
| - return false;
|
| + return PP_FALSE;
|
| }
|
|
|
| -bool AppendDataToBody(PP_Resource request_id, const char* data, uint32_t len) {
|
| +PP_Bool AppendDataToBody(PP_Resource request_id,
|
| + const char* data,
|
| + uint32_t len) {
|
| scoped_refptr<URLRequestInfo> request(
|
| Resource::GetAs<URLRequestInfo>(request_id));
|
| if (!request)
|
| - return false;
|
| + return PP_FALSE;
|
|
|
| - return request->AppendDataToBody(std::string(data, len));
|
| + return BoolToPPBool(request->AppendDataToBody(std::string(data, len)));
|
| }
|
|
|
| -bool AppendFileToBody(PP_Resource request_id,
|
| +PP_Bool AppendFileToBody(PP_Resource request_id,
|
| PP_Resource file_ref_id,
|
| int64_t start_offset,
|
| int64_t number_of_bytes,
|
| @@ -97,16 +105,16 @@
|
| scoped_refptr<URLRequestInfo> request(
|
| Resource::GetAs<URLRequestInfo>(request_id));
|
| if (!request)
|
| - return false;
|
| + return PP_FALSE;
|
|
|
| scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
|
| if (!file_ref)
|
| - return false;
|
| + return PP_FALSE;
|
|
|
| - return request->AppendFileToBody(file_ref,
|
| - start_offset,
|
| - number_of_bytes,
|
| - expected_last_modified_time);
|
| + return BoolToPPBool(request->AppendFileToBody(file_ref,
|
| + start_offset,
|
| + number_of_bytes,
|
| + expected_last_modified_time));
|
| }
|
|
|
| const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = {
|
|
|