Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: webkit/glue/plugins/pepper_url_request_info.cc

Issue 4310002: Make PPAPI headers compile with C compilers (gcc on Linux & Mac and MSVS on W... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/plugins/pepper_url_loader.cc ('k') | webkit/glue/plugins/pepper_url_response_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = {
« no previous file with comments | « webkit/glue/plugins/pepper_url_loader.cc ('k') | webkit/glue/plugins/pepper_url_response_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698