diff options
35 files changed, 281 insertions, 326 deletions
diff --git a/ppapi/c/dev/ppb_url_loader_dev.h b/ppapi/c/ppb_url_loader.h index c0c5fff..7d039d6 100644 --- a/ppapi/c/dev/ppb_url_loader_dev.h +++ b/ppapi/c/ppb_url_loader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_C_DEV_PPB_URL_LOADER_DEV_H_ -#define PPAPI_C_DEV_PPB_URL_LOADER_DEV_H_ +#ifndef PPAPI_C_PPB_URL_LOADER_H_ +#define PPAPI_C_PPB_URL_LOADER_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" @@ -12,7 +12,7 @@ struct PP_CompletionCallback; -#define PPB_URLLOADER_DEV_INTERFACE "PPB_URLLoader(Dev);0.2" +#define PPB_URLLOADER_INTERFACE "PPB_URLLoader;1" // The interface for loading URLs. // @@ -28,7 +28,7 @@ struct PP_CompletionCallback; // downloaded file to be complete. The downloaded file may be accessed via the // GetBody method of the URLResponseInfo returned in step #4. // -struct PPB_URLLoader_Dev { +struct PPB_URLLoader { // Create a new URLLoader object. Returns 0 if the instance is invalid. The // URLLoader is associated with a particular instance, so that any UI dialogs // that need to be shown to the user can be positioned relative to the window @@ -106,4 +106,4 @@ struct PPB_URLLoader_Dev { void (*Close)(PP_Resource loader); }; -#endif // PPAPI_C_DEV_PPB_URL_LOADER_DEV_H_ +#endif // PPAPI_C_PPB_URL_LOADER_H_ diff --git a/ppapi/c/dev/ppb_url_request_info_dev.h b/ppapi/c/ppb_url_request_info.h index 26c6b2e..1c697fc1 100644 --- a/ppapi/c/dev/ppb_url_request_info_dev.h +++ b/ppapi/c/ppb_url_request_info.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_C_DEV_PPB_URL_REQUEST_INFO_DEV_H_ -#define PPAPI_C_DEV_PPB_URL_REQUEST_INFO_DEV_H_ +#ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ +#define PPAPI_C_PPB_URL_REQUEST_INFO_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_module.h" @@ -31,13 +31,11 @@ typedef enum { // // Boolean (default = PP_FALSE). PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS +} PP_URLRequestProperty; - // TODO(darin): Add security/privacy options? -} PP_URLRequestProperty_Dev; +#define PPB_URLREQUESTINFO_INTERFACE "PPB_URLRequestInfo;1" -#define PPB_URLREQUESTINFO_DEV_INTERFACE "PPB_URLRequestInfo(Dev);0.2" - -struct PPB_URLRequestInfo_Dev { +struct PPB_URLRequestInfo { // Create a new URLRequestInfo object. Returns 0 if the module is invalid. PP_Resource (*Create)(PP_Module module); @@ -50,7 +48,7 @@ struct PPB_URLRequestInfo_Dev { // invalid, PP_TRUE on success. The value property must be the correct type // according to the property being set. PP_Bool (*SetProperty)(PP_Resource request, - PP_URLRequestProperty_Dev property, + PP_URLRequestProperty property, struct PP_Var value); // Append data to the request body. @@ -84,4 +82,4 @@ struct PPB_URLRequestInfo_Dev { PP_Time expected_last_modified_time); }; -#endif // PPAPI_C_DEV_PPB_URL_REQUEST_INFO_DEV_H_ +#endif // PPAPI_C_PPB_URL_REQUEST_INFO_H_ diff --git a/ppapi/c/dev/ppb_url_response_info_dev.h b/ppapi/c/ppb_url_response_info.h index e1307f5..97627ab 100644 --- a/ppapi/c/dev/ppb_url_response_info_dev.h +++ b/ppapi/c/ppb_url_response_info.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_C_DEV_PPB_URL_RESPONSE_INFO_DEV_H_ -#define PPAPI_C_DEV_PPB_URL_RESPONSE_INFO_DEV_H_ +#ifndef PPAPI_C_PPB_URL_RESPONSE_INFO_H_ +#define PPAPI_C_PPB_URL_RESPONSE_INFO_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_resource.h" @@ -16,11 +16,11 @@ typedef enum { PP_URLRESPONSEPROPERTY_STATUSCODE, // int32 PP_URLRESPONSEPROPERTY_STATUSLINE, // string PP_URLRESPONSEPROPERTY_HEADERS // string, \n-delim -} PP_URLResponseProperty_Dev; +} PP_URLResponseProperty; -#define PPB_URLRESPONSEINFO_DEV_INTERFACE "PPB_URLResponseInfo(Dev);0.2" +#define PPB_URLRESPONSEINFO_INTERFACE "PPB_URLResponseInfo;1" -struct PPB_URLResponseInfo_Dev { +struct PPB_URLResponseInfo { // Returns PP_TRUE if the given resource is an URLResponseInfo. Returns // PP_FALSE if the resource is invalid or some type other than an // URLResponseInfo. @@ -29,7 +29,7 @@ struct PPB_URLResponseInfo_Dev { // Gets a response property. Return PP_VarType_Void if an input parameter is // invalid. struct PP_Var (*GetProperty)(PP_Resource response, - PP_URLResponseProperty_Dev property); + PP_URLResponseProperty property); // Returns a FileRef pointing to the file containing the response body. This // is only valid if PP_URLREQUESTPROPERTY_STREAMTOFILE was set on the @@ -37,7 +37,7 @@ struct PPB_URLResponseInfo_Dev { // until the URLLoader associated with this URLResponseInfo is closed or // destroyed. Returns 0 if PP_URLREQUESTPROPERTY_STREAMTOFILE was not // requested or if the URLLoader has not been opened yet. - PP_Resource (*GetBody)(PP_Resource response); + PP_Resource (*GetBodyAsFileRef)(PP_Resource response); }; -#endif // PPAPI_C_DEV_PPB_URL_RESPONSE_INFO_DEV_H_ +#endif // PPAPI_C_PPB_URL_RESPONSE_INFO_H_ diff --git a/ppapi/c/dev/ppb_url_loader_trusted_dev.h b/ppapi/c/trusted/ppb_url_loader_trusted.h index 84aff0e..4e027f9 100644 --- a/ppapi/c/dev/ppb_url_loader_trusted_dev.h +++ b/ppapi/c/trusted/ppb_url_loader_trusted.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_C_DEV_PPB_URL_LOADER_TRUSTED_DEV_H_ -#define PPAPI_C_DEV_PPB_URL_LOADER_TRUSTED_DEV_H_ +#ifndef PPAPI_C_PPB_URL_LOADER_TRUSTED_H_ +#define PPAPI_C_PPB_URL_LOADER_TRUSTED_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -#define PPB_URLLOADERTRUSTED_DEV_INTERFACE "PPB_URLLoaderTrusted(Dev);0.2" +#define PPB_URLLOADERTRUSTED_INTERFACE "PPB_URLLoaderTrusted;0.2" // Callback that indicates the status of the download and upload for the // given URLLoader resource. @@ -22,7 +22,7 @@ typedef void (*PP_URLLoaderTrusted_StatusCallback)( int64_t total_bytes_to_be_received); // Available only to trusted implementations. -struct PPB_URLLoaderTrusted_Dev { +struct PPB_URLLoaderTrusted { // Grant this URLLoader the capability to make unrestricted cross-origin // requests. void (*GrantUniversalAccess)(PP_Resource loader); @@ -42,4 +42,4 @@ struct PPB_URLLoaderTrusted_Dev { PP_URLLoaderTrusted_StatusCallback cb); }; -#endif // PPAPI_C_DEV_PPB_URL_LOADER_DEV_H_ +#endif // PPAPI_C_PPB_URL_LOADER_H_ diff --git a/ppapi/cpp/dev/url_response_info_dev.cc b/ppapi/cpp/dev/url_response_info_dev.cc deleted file mode 100644 index abeca7f..0000000 --- a/ppapi/cpp/dev/url_response_info_dev.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/cpp/dev/url_response_info_dev.h" - -#include "ppapi/cpp/dev/file_ref_dev.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/module_impl.h" - -namespace { - -DeviceFuncs<PPB_URLResponseInfo_Dev> url_response_info_f( - PPB_URLRESPONSEINFO_DEV_INTERFACE); - -} // namespace - -namespace pp { - -URLResponseInfo_Dev::URLResponseInfo_Dev(const URLResponseInfo_Dev& other) - : Resource(other) { -} - -URLResponseInfo_Dev::URLResponseInfo_Dev(PassRef, PP_Resource resource) { - PassRefFromConstructor(resource); -} - -URLResponseInfo_Dev& URLResponseInfo_Dev::operator=( - const URLResponseInfo_Dev& other) { - URLResponseInfo_Dev copy(other); - swap(copy); - return *this; -} - -void URLResponseInfo_Dev::swap(URLResponseInfo_Dev& other) { - Resource::swap(other); -} - -Var URLResponseInfo_Dev::GetProperty( - PP_URLResponseProperty_Dev property) const { - if (!url_response_info_f) - return Var(); - return Var(Var::PassRef(), - url_response_info_f->GetProperty(pp_resource(), property)); -} - -FileRef_Dev URLResponseInfo_Dev::GetBody() const { - if (!url_response_info_f) - return FileRef_Dev(); - return FileRef_Dev(FileRef_Dev::PassRef(), - url_response_info_f->GetBody(pp_resource())); -} - -} // namespace pp diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc index 86996d6..394be04 100644 --- a/ppapi/cpp/instance.cc +++ b/ppapi/cpp/instance.cc @@ -8,8 +8,6 @@ #include "ppapi/c/ppb_instance.h" #include "ppapi/cpp/common.h" #include "ppapi/cpp/dev/graphics_3d_dev.h" -#include "ppapi/cpp/dev/scrollbar_dev.h" -#include "ppapi/cpp/dev/widget_dev.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/logging.h" @@ -53,7 +51,7 @@ void Instance::DidChangeFocus(bool /*has_focus*/) { } -bool Instance::HandleDocumentLoad(const URLLoader_Dev& /*url_loader*/) { +bool Instance::HandleDocumentLoad(const URLLoader& /*url_loader*/) { return false; } diff --git a/ppapi/cpp/instance.h b/ppapi/cpp/instance.h index e0a5889..d74995e 100644 --- a/ppapi/cpp/instance.h +++ b/ppapi/cpp/instance.h @@ -16,7 +16,6 @@ #include <map> #include <string> -#include "ppapi/c/dev/ppp_printing_dev.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" @@ -33,8 +32,7 @@ class Point; class Rect; class Rect; class Resource; -class Scrollbar_Dev; -class URLLoader_Dev; +class URLLoader; class Var; class Widget_Dev; @@ -69,7 +67,7 @@ class Instance { virtual bool HandleInputEvent(const PP_InputEvent& event); /** See PPP_Instance.HandleDocumentLoad. */ - virtual bool HandleDocumentLoad(const URLLoader_Dev& url_loader); + virtual bool HandleDocumentLoad(const URLLoader& url_loader); /** See PPP_Instance.GetInstanceObject. */ virtual Var GetInstanceObject(); diff --git a/ppapi/cpp/module.cc b/ppapi/cpp/module.cc index 1aa5ea8..d6adddc 100644 --- a/ppapi/cpp/module.cc +++ b/ppapi/cpp/module.cc @@ -29,7 +29,7 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/cpp/common.h" -#include "ppapi/cpp/dev/url_loader_dev.h" +#include "ppapi/cpp/url_loader.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/rect.h" #include "ppapi/cpp/resource.h" @@ -111,7 +111,7 @@ PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance, if (!instance) return PP_FALSE; return BoolToPPBool( - instance->HandleDocumentLoad(URLLoader_Dev(pp_url_loader))); + instance->HandleDocumentLoad(URLLoader(pp_url_loader))); } PP_Var Instance_GetInstanceObject(PP_Instance pp_instance) { diff --git a/ppapi/cpp/dev/url_loader_dev.cc b/ppapi/cpp/url_loader.cc index b7fdc03..2a56a83 100644 --- a/ppapi/cpp/dev/url_loader_dev.cc +++ b/ppapi/cpp/url_loader.cc @@ -2,67 +2,56 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/cpp/dev/url_loader_dev.h" +#include "ppapi/cpp/url_loader.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" +#include "ppapi/c/ppb_url_loader.h" #include "ppapi/c/pp_errors.h" #include "ppapi/cpp/common.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/file_ref_dev.h" -#include "ppapi/cpp/dev/url_request_info_dev.h" -#include "ppapi/cpp/dev/url_response_info_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" +#include "ppapi/cpp/url_request_info.h" +#include "ppapi/cpp/url_response_info.h" namespace { -DeviceFuncs<PPB_URLLoader_Dev> url_loader_f(PPB_URLLOADER_DEV_INTERFACE); +DeviceFuncs<PPB_URLLoader> url_loader_f(PPB_URLLOADER_INTERFACE); } // namespace namespace pp { -URLLoader_Dev::URLLoader_Dev(PP_Resource resource) : Resource(resource) { +URLLoader::URLLoader(PP_Resource resource) : Resource(resource) { } -URLLoader_Dev::URLLoader_Dev(const Instance& instance) { +URLLoader::URLLoader(const Instance& instance) { if (!url_loader_f) return; PassRefFromConstructor(url_loader_f->Create(instance.pp_instance())); } -URLLoader_Dev::URLLoader_Dev(const URLLoader_Dev& other) - : Resource(other) { +URLLoader::URLLoader(const URLLoader& other) : Resource(other) { } -URLLoader_Dev& URLLoader_Dev::operator=(const URLLoader_Dev& other) { - URLLoader_Dev copy(other); - swap(copy); - return *this; -} - -void URLLoader_Dev::swap(URLLoader_Dev& other) { - Resource::swap(other); -} - -int32_t URLLoader_Dev::Open(const URLRequestInfo_Dev& request_info, - const CompletionCallback& cc) { +int32_t URLLoader::Open(const URLRequestInfo& request_info, + const CompletionCallback& cc) { if (!url_loader_f) return PP_ERROR_NOINTERFACE; return url_loader_f->Open(pp_resource(), request_info.pp_resource(), cc.pp_completion_callback()); } -int32_t URLLoader_Dev::FollowRedirect(const CompletionCallback& cc) { +int32_t URLLoader::FollowRedirect(const CompletionCallback& cc) { if (!url_loader_f) return PP_ERROR_NOINTERFACE; return url_loader_f->FollowRedirect(pp_resource(), cc.pp_completion_callback()); } -bool URLLoader_Dev::GetUploadProgress(int64_t* bytes_sent, - int64_t* total_bytes_to_be_sent) const { +bool URLLoader::GetUploadProgress(int64_t* bytes_sent, + int64_t* total_bytes_to_be_sent) const { if (!url_loader_f) return false; return PPBoolToBool(url_loader_f->GetUploadProgress(pp_resource(), @@ -70,7 +59,7 @@ bool URLLoader_Dev::GetUploadProgress(int64_t* bytes_sent, total_bytes_to_be_sent)); } -bool URLLoader_Dev::GetDownloadProgress( +bool URLLoader::GetDownloadProgress( int64_t* bytes_received, int64_t* total_bytes_to_be_received) const { if (!url_loader_f) @@ -81,16 +70,16 @@ bool URLLoader_Dev::GetDownloadProgress( total_bytes_to_be_received)); } -URLResponseInfo_Dev URLLoader_Dev::GetResponseInfo() const { +URLResponseInfo URLLoader::GetResponseInfo() const { if (!url_loader_f) - return URLResponseInfo_Dev(); - return URLResponseInfo_Dev(URLResponseInfo_Dev::PassRef(), - url_loader_f->GetResponseInfo(pp_resource())); + return URLResponseInfo(); + return URLResponseInfo(URLResponseInfo::PassRef(), + url_loader_f->GetResponseInfo(pp_resource())); } -int32_t URLLoader_Dev::ReadResponseBody(char* buffer, - int32_t bytes_to_read, - const CompletionCallback& cc) { +int32_t URLLoader::ReadResponseBody(char* buffer, + int32_t bytes_to_read, + const CompletionCallback& cc) { if (!url_loader_f) return PP_ERROR_NOINTERFACE; return url_loader_f->ReadResponseBody(pp_resource(), @@ -99,14 +88,14 @@ int32_t URLLoader_Dev::ReadResponseBody(char* buffer, cc.pp_completion_callback()); } -int32_t URLLoader_Dev::FinishStreamingToFile(const CompletionCallback& cc) { +int32_t URLLoader::FinishStreamingToFile(const CompletionCallback& cc) { if (!url_loader_f) return PP_ERROR_NOINTERFACE; return url_loader_f->FinishStreamingToFile(pp_resource(), cc.pp_completion_callback()); } -void URLLoader_Dev::Close() { +void URLLoader::Close() { if (!url_loader_f) return; url_loader_f->Close(pp_resource()); diff --git a/ppapi/cpp/dev/url_loader_dev.h b/ppapi/cpp/url_loader.h index 4256c32..15f81fa 100644 --- a/ppapi/cpp/dev/url_loader_dev.h +++ b/ppapi/cpp/url_loader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_CPP_DEV_URL_LOADER_DEV_H_ -#define PPAPI_CPP_DEV_URL_LOADER_DEV_H_ +#ifndef PPAPI_CPP_URL_LOADER_H_ +#define PPAPI_CPP_URL_LOADER_H_ #include "ppapi/c/pp_stdint.h" #include "ppapi/cpp/resource.h" @@ -12,8 +12,8 @@ namespace pp { class CompletionCallback; class Instance; -class URLRequestInfo_Dev; -class URLResponseInfo_Dev; +class URLRequestInfo; +class URLResponseInfo; // URLLoader provides an API to download URLs. // @@ -75,27 +75,24 @@ class URLResponseInfo_Dev; // bool did_open_; // }; // -class URLLoader_Dev : public Resource { +class URLLoader : public Resource { public: // Creates an is_null() URLLoader object. - URLLoader_Dev() {} + URLLoader() {} - explicit URLLoader_Dev(PP_Resource resource); - explicit URLLoader_Dev(const Instance& instance); - URLLoader_Dev(const URLLoader_Dev& other); - - URLLoader_Dev& operator=(const URLLoader_Dev& other); - void swap(URLLoader_Dev& other); + explicit URLLoader(PP_Resource resource); + explicit URLLoader(const Instance& instance); + URLLoader(const URLLoader& other); // PPB_URLLoader methods: - int32_t Open(const URLRequestInfo_Dev& request_info, + int32_t Open(const URLRequestInfo& request_info, const CompletionCallback& cc); int32_t FollowRedirect(const CompletionCallback& cc); bool GetUploadProgress(int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) const; bool GetDownloadProgress(int64_t* bytes_received, int64_t* total_bytes_to_be_received) const; - URLResponseInfo_Dev GetResponseInfo() const; + URLResponseInfo GetResponseInfo() const; int32_t ReadResponseBody(char* buffer, int32_t bytes_to_read, const CompletionCallback& cc); @@ -105,4 +102,4 @@ class URLLoader_Dev : public Resource { } // namespace pp -#endif // PPAPI_CPP_DEV_URL_LOADER_DEV_H_ +#endif // PPAPI_CPP_URL_LOADER_H_ diff --git a/ppapi/cpp/dev/url_request_info_dev.cc b/ppapi/cpp/url_request_info.cc index 5b4a135..69a86cb 100644 --- a/ppapi/cpp/dev/url_request_info_dev.cc +++ b/ppapi/cpp/url_request_info.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/cpp/dev/url_request_info_dev.h" +#include "ppapi/cpp/url_request_info.h" #include "ppapi/cpp/common.h" #include "ppapi/cpp/dev/file_ref_dev.h" @@ -11,37 +11,26 @@ namespace { -DeviceFuncs<PPB_URLRequestInfo_Dev> url_request_info_f( - PPB_URLREQUESTINFO_DEV_INTERFACE); +DeviceFuncs<PPB_URLRequestInfo> url_request_info_f( + PPB_URLREQUESTINFO_INTERFACE); } // namespace namespace pp { -URLRequestInfo_Dev::URLRequestInfo_Dev() { +URLRequestInfo::URLRequestInfo() { if (!url_request_info_f) return; PassRefFromConstructor( url_request_info_f->Create(Module::Get()->pp_module())); } -URLRequestInfo_Dev::URLRequestInfo_Dev(const URLRequestInfo_Dev& other) +URLRequestInfo::URLRequestInfo(const URLRequestInfo& other) : Resource(other) { } -URLRequestInfo_Dev& URLRequestInfo_Dev::operator=( - const URLRequestInfo_Dev& other) { - URLRequestInfo_Dev copy(other); - swap(copy); - return *this; -} - -void URLRequestInfo_Dev::swap(URLRequestInfo_Dev& other) { - Resource::swap(other); -} - -bool URLRequestInfo_Dev::SetProperty(PP_URLRequestProperty_Dev property, - const Var& value) { +bool URLRequestInfo::SetProperty(PP_URLRequestProperty property, + const Var& value) { if (!url_request_info_f) return false; return PPBoolToBool(url_request_info_f->SetProperty(pp_resource(), @@ -49,7 +38,7 @@ bool URLRequestInfo_Dev::SetProperty(PP_URLRequestProperty_Dev property, value.pp_var())); } -bool URLRequestInfo_Dev::AppendDataToBody(const char* data, uint32_t len) { +bool URLRequestInfo::AppendDataToBody(const char* data, uint32_t len) { if (!url_request_info_f) return false; return PPBoolToBool(url_request_info_f->AppendDataToBody(pp_resource(), @@ -57,9 +46,8 @@ bool URLRequestInfo_Dev::AppendDataToBody(const char* data, uint32_t len) { len)); } -bool URLRequestInfo_Dev::AppendFileToBody( - const FileRef_Dev& file_ref, - PP_Time expected_last_modified_time) { +bool URLRequestInfo::AppendFileToBody(const FileRef_Dev& file_ref, + PP_Time expected_last_modified_time) { if (!url_request_info_f) return false; return PPBoolToBool( @@ -70,7 +58,7 @@ bool URLRequestInfo_Dev::AppendFileToBody( expected_last_modified_time)); } -bool URLRequestInfo_Dev::AppendFileRangeToBody( +bool URLRequestInfo::AppendFileRangeToBody( const FileRef_Dev& file_ref, int64_t start_offset, int64_t length, diff --git a/ppapi/cpp/dev/url_request_info_dev.h b/ppapi/cpp/url_request_info.h index 1d56543..10defc1 100644 --- a/ppapi/cpp/dev/url_request_info_dev.h +++ b/ppapi/cpp/url_request_info.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_CPP_DEV_URL_REQUEST_INFO_DEV_H_ -#define PPAPI_CPP_DEV_URL_REQUEST_INFO_DEV_H_ +#ifndef PPAPI_CPP_URL_REQUEST_INFO_H_ +#define PPAPI_CPP_URL_REQUEST_INFO_H_ -#include "ppapi/c/dev/ppb_url_request_info_dev.h" +#include "ppapi/c/ppb_url_request_info.h" #include "ppapi/cpp/resource.h" #include "ppapi/cpp/var.h" @@ -13,16 +13,13 @@ namespace pp { class FileRef_Dev; -class URLRequestInfo_Dev : public Resource { +class URLRequestInfo : public Resource { public: - URLRequestInfo_Dev(); - URLRequestInfo_Dev(const URLRequestInfo_Dev& other); + URLRequestInfo(); + URLRequestInfo(const URLRequestInfo& other); - URLRequestInfo_Dev& operator=(const URLRequestInfo_Dev& other); - void swap(URLRequestInfo_Dev& other); - - // PPB_URLRequestInfo_Dev methods: - bool SetProperty(PP_URLRequestProperty_Dev property, const Var& value); + // PPB_URLRequestInfo methods: + bool SetProperty(PP_URLRequestProperty property, const Var& value); bool AppendDataToBody(const char* data, uint32_t len); bool AppendFileToBody(const FileRef_Dev& file_ref, PP_Time expected_last_modified_time = 0); @@ -54,4 +51,4 @@ class URLRequestInfo_Dev : public Resource { } // namespace pp -#endif // PPAPI_CPP_DEV_URL_REQUEST_INFO_DEV_H_ +#endif // PPAPI_CPP_URL_REQUEST_INFO_H_ diff --git a/ppapi/cpp/url_response_info.cc b/ppapi/cpp/url_response_info.cc new file mode 100644 index 0000000..4a023aa --- /dev/null +++ b/ppapi/cpp/url_response_info.cc @@ -0,0 +1,42 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/cpp/url_response_info.h" + +#include "ppapi/cpp/dev/file_ref_dev.h" +#include "ppapi/cpp/module.h" +#include "ppapi/cpp/module_impl.h" + +namespace { + +DeviceFuncs<PPB_URLResponseInfo> url_response_info_f( + PPB_URLRESPONSEINFO_INTERFACE); + +} // namespace + +namespace pp { + +URLResponseInfo::URLResponseInfo(const URLResponseInfo& other) + : Resource(other) { +} + +URLResponseInfo::URLResponseInfo(PassRef, PP_Resource resource) { + PassRefFromConstructor(resource); +} + +Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) const { + if (!url_response_info_f) + return Var(); + return Var(Var::PassRef(), + url_response_info_f->GetProperty(pp_resource(), property)); +} + +FileRef_Dev URLResponseInfo::GetBodyAsFileRef() const { + if (!url_response_info_f) + return FileRef_Dev(); + return FileRef_Dev(FileRef_Dev::PassRef(), + url_response_info_f->GetBodyAsFileRef(pp_resource())); +} + +} // namespace pp diff --git a/ppapi/cpp/dev/url_response_info_dev.h b/ppapi/cpp/url_response_info.h index 6596c8b..ac13b27 100644 --- a/ppapi/cpp/dev/url_response_info_dev.h +++ b/ppapi/cpp/url_response_info.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_CPP_DEV_URL_RESPONSE_INFO_DEV_H_ -#define PPAPI_CPP_DEV_URL_RESPONSE_INFO_DEV_H_ +#ifndef PPAPI_CPP_URL_RESPONSE_INFO_H_ +#define PPAPI_CPP_URL_RESPONSE_INFO_H_ -#include "ppapi/c/dev/ppb_url_response_info_dev.h" +#include "ppapi/c/ppb_url_response_info.h" #include "ppapi/cpp/resource.h" #include "ppapi/cpp/var.h" @@ -13,24 +13,21 @@ namespace pp { class FileRef_Dev; -class URLResponseInfo_Dev : public Resource { +class URLResponseInfo : public Resource { public: // Creates an is_null() URLResponseInfo object. - URLResponseInfo_Dev() {} + URLResponseInfo() {} // This constructor is used when we've gotten a PP_Resource as a return value // that has already been addref'ed for us. struct PassRef {}; - URLResponseInfo_Dev(PassRef, PP_Resource resource); + URLResponseInfo(PassRef, PP_Resource resource); - URLResponseInfo_Dev(const URLResponseInfo_Dev& other); - - URLResponseInfo_Dev& operator=(const URLResponseInfo_Dev& other); - void swap(URLResponseInfo_Dev& other); + URLResponseInfo(const URLResponseInfo& other); // PPB_URLResponseInfo methods: - Var GetProperty(PP_URLResponseProperty_Dev property) const; - FileRef_Dev GetBody() const; + Var GetProperty(PP_URLResponseProperty property) const; + FileRef_Dev GetBodyAsFileRef() const; // Convenient helpers for getting properties: Var GetURL() const { @@ -55,4 +52,4 @@ class URLResponseInfo_Dev : public Resource { } // namespace pp -#endif // PPAPI_CPP_DEV_URL_RESPONSE_INFO_DEV_H_ +#endif // PPAPI_CPP_URL_RESPONSE_INFO_H_ diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc index bb3825f..ab5a248 100644 --- a/ppapi/example/example.cc +++ b/ppapi/example/example.cc @@ -17,13 +17,13 @@ #include "ppapi/c/pp_rect.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" -#include "ppapi/cpp/dev/url_loader_dev.h" -#include "ppapi/cpp/dev/url_request_info_dev.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/rect.h" +#include "ppapi/cpp/url_loader.h" +#include "ppapi/cpp/url_request_info.h" #include "ppapi/cpp/var.h" static const int kStepsPerCircle = 800; @@ -88,11 +88,11 @@ class MyFetcher { void Start(const pp::Instance& instance, const pp::Var& url, MyFetcherClient* client) { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL(url); request.SetMethod("GET"); - loader_ = pp::URLLoader_Dev(instance); + loader_ = pp::URLLoader(instance); client_ = client; pp::CompletionCallback callback = @@ -102,7 +102,7 @@ class MyFetcher { callback.Run(rv); } - void StartWithOpenedLoader(const pp::URLLoader_Dev& loader, + void StartWithOpenedLoader(const pp::URLLoader& loader, MyFetcherClient* client) { loader_ = loader; client_ = client; @@ -142,7 +142,7 @@ class MyFetcher { } pp::CompletionCallbackFactory<MyFetcher> callback_factory_; - pp::URLLoader_Dev loader_; + pp::URLLoader loader_; MyFetcherClient* client_; char buf_[4096]; std::string data_; @@ -170,7 +170,7 @@ class MyInstance : public pp::Instance, public MyFetcherClient { return true; } - virtual bool HandleDocumentLoad(const pp::URLLoader_Dev& loader) { + virtual bool HandleDocumentLoad(const pp::URLLoader& loader) { fetcher_ = new MyFetcher(); fetcher_->StartWithOpenedLoader(loader, this); return true; diff --git a/ppapi/ppapi.gyp b/ppapi/ppapi.gyp index 04c3048..a21b30a 100644 --- a/ppapi/ppapi.gyp +++ b/ppapi/ppapi.gyp @@ -58,6 +58,9 @@ 'c/ppb_graphics_2d.h', 'c/ppb_image_data.h', 'c/ppb_instance.h', + 'c/ppb_url_loader.h', + 'c/ppb_url_request_info.h', + 'c/ppb_url_response_info.h', 'c/ppb_var.h', 'c/ppp.h', 'c/ppp_instance.h', @@ -86,10 +89,6 @@ 'c/dev/ppb_scrollbar_dev.h', 'c/dev/ppb_testing_dev.h', 'c/dev/ppb_transport_dev.h', - 'c/dev/ppb_url_loader_dev.h', - 'c/dev/ppb_url_loader_trusted_dev.h', - 'c/dev/ppb_url_request_info_dev.h', - 'c/dev/ppb_url_response_info_dev.h', 'c/dev/ppb_url_util_dev.h', 'c/dev/ppb_video_decoder_dev.h', 'c/dev/ppb_zoom_dev.h', @@ -106,6 +105,10 @@ 'c/dev/deprecated_bool.h', 'c/dev/ppb_var_deprecated.h', 'c/dev/ppp_class_deprecated.h', + + # Trusted interfaces. + 'c/trusted/ppb_image_data_trusted.h', + 'c/trusted/ppb_url_loader_trusted.h', ], }, { @@ -142,6 +145,12 @@ 'cpp/resource.cc', 'cpp/resource.h', 'cpp/size.h', + 'cpp/url_loader.cc', + 'cpp/url_loader.h', + 'cpp/url_request_info.cc', + 'cpp/url_request_info.h', + 'cpp/url_response_info.cc', + 'cpp/url_response_info.h', 'cpp/var.cc', 'cpp/var.h', @@ -182,12 +191,6 @@ 'cpp/dev/selection_dev.h', 'cpp/dev/transport_dev.cc', 'cpp/dev/transport_dev.h', - 'cpp/dev/url_loader_dev.cc', - 'cpp/dev/url_loader_dev.h', - 'cpp/dev/url_request_info_dev.cc', - 'cpp/dev/url_request_info_dev.h', - 'cpp/dev/url_response_info_dev.cc', - 'cpp/dev/url_response_info_dev.h', 'cpp/dev/url_util_dev.cc', 'cpp/dev/url_util_dev.h', 'cpp/dev/video_decoder_dev.cc', diff --git a/ppapi/proxy/dispatcher.cc b/ppapi/proxy/dispatcher.cc index 476f403..eecc9a0 100644 --- a/ppapi/proxy/dispatcher.cc +++ b/ppapi/proxy/dispatcher.cc @@ -15,9 +15,6 @@ #include "ppapi/proxy/interface_proxy.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/c/dev/ppb_testing_dev.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" -#include "ppapi/c/dev/ppb_url_request_info_dev.h" -#include "ppapi/c/dev/ppb_url_response_info_dev.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_core.h" @@ -25,6 +22,9 @@ #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppp_instance.h" +#include "ppapi/c/ppb_url_loader.h" +#include "ppapi/c/ppb_url_request_info.h" +#include "ppapi/c/ppb_url_response_info.h" #include "ppapi/proxy/ppb_core_proxy.h" #include "ppapi/proxy/ppb_graphics_2d_proxy.h" #include "ppapi/proxy/ppb_image_data_proxy.h" @@ -213,11 +213,11 @@ InterfaceProxy* Dispatcher::CreateProxyForInterface( return new PPB_Instance_Proxy(this, interface_functions); if (interface_name == PPB_TESTING_DEV_INTERFACE) return new PPB_Testing_Proxy(this, interface_functions); - if (interface_name == PPB_URLLOADER_DEV_INTERFACE) + if (interface_name == PPB_URLLOADER_INTERFACE) return new PPB_URLLoader_Proxy(this, interface_functions); - if (interface_name == PPB_URLREQUESTINFO_DEV_INTERFACE) + if (interface_name == PPB_URLREQUESTINFO_INTERFACE) return new PPB_URLRequestInfo_Proxy(this, interface_functions); - if (interface_name == PPB_URLRESPONSEINFO_DEV_INTERFACE) + if (interface_name == PPB_URLRESPONSEINFO_INTERFACE) return new PPB_URLResponseInfo_Proxy(this, interface_functions); if (interface_name == PPB_VAR_DEPRECATED_INTERFACE) return new PPB_Var_Deprecated_Proxy(this, interface_functions); diff --git a/ppapi/proxy/ppapi_messages_internal.h b/ppapi/proxy/ppapi_messages_internal.h index e5a8222..9375d1d 100644 --- a/ppapi/proxy/ppapi_messages_internal.h +++ b/ppapi/proxy/ppapi_messages_internal.h @@ -313,7 +313,7 @@ IPC_BEGIN_MESSAGES(PpapiHost) PP_Resource /* response */, int32_t /* property */, pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLResponseInfo_GetBody, + IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, PP_Resource /* response */, PP_Resource /* file_ref_result */) diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc index 481ceb9..230535d7 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.cc +++ b/ppapi/proxy/ppb_url_loader_proxy.cc @@ -11,7 +11,7 @@ #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/pp_resource.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" +#include "ppapi/c/ppb_url_loader.h" #include "ppapi/proxy/host_dispatcher.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/plugin_resource.h" @@ -188,7 +188,7 @@ void Close(PP_Resource loader_id) { INTERFACE_ID_PPB_URL_LOADER, loader_id)); } -const PPB_URLLoader_Dev ppb_urlloader = { +const PPB_URLLoader ppb_urlloader = { &Create, &IsURLLoader, &Open, diff --git a/ppapi/proxy/ppb_url_loader_proxy.h b/ppapi/proxy/ppb_url_loader_proxy.h index cc35677..cd767b0 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.h +++ b/ppapi/proxy/ppb_url_loader_proxy.h @@ -14,7 +14,7 @@ #include "ppapi/c/pp_var.h" #include "ppapi/proxy/interface_proxy.h" -struct PPB_URLLoader_Dev; +struct PPB_URLLoader; namespace pp { namespace proxy { @@ -31,8 +31,8 @@ class PPB_URLLoader_Proxy : public InterfaceProxy, // proxied info for the given browser-supplied URLLoader resource ID. static void TrackPluginResource(PP_Resource url_loader_resource); - const PPB_URLLoader_Dev* ppb_url_loader_target() const { - return reinterpret_cast<const PPB_URLLoader_Dev*>(target_interface()); + const PPB_URLLoader* ppb_url_loader_target() const { + return reinterpret_cast<const PPB_URLLoader*>(target_interface()); } // InterfaceProxy implementation. diff --git a/ppapi/proxy/ppb_url_request_info_proxy.cc b/ppapi/proxy/ppb_url_request_info_proxy.cc index 2df496b..6a91286 100644 --- a/ppapi/proxy/ppb_url_request_info_proxy.cc +++ b/ppapi/proxy/ppb_url_request_info_proxy.cc @@ -4,7 +4,7 @@ #include "ppapi/proxy/ppb_url_request_info_proxy.h" -#include "ppapi/c/dev/ppb_url_request_info_dev.h" +#include "ppapi/c/ppb_url_request_info.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_messages.h" @@ -44,7 +44,7 @@ PP_Bool IsURLRequestInfo(PP_Resource resource) { } PP_Bool SetProperty(PP_Resource request_id, - PP_URLRequestProperty_Dev property, + PP_URLRequestProperty property, PP_Var var) { Dispatcher* dispatcher = PluginDispatcher::Get(); dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_SetProperty( @@ -84,7 +84,7 @@ PP_Bool AppendFileToBody(PP_Resource request_id, return PP_TRUE; } -const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { +const PPB_URLRequestInfo ppb_urlrequestinfo = { &Create, &IsURLRequestInfo, &SetProperty, @@ -135,7 +135,7 @@ void PPB_URLRequestInfo_Proxy::OnMsgSetProperty( int32_t property, SerializedVarReceiveInput value) { ppb_url_request_info_target()->SetProperty(request, - static_cast<PP_URLRequestProperty_Dev>(property), + static_cast<PP_URLRequestProperty>(property), value.Get(dispatcher())); } diff --git a/ppapi/proxy/ppb_url_request_info_proxy.h b/ppapi/proxy/ppb_url_request_info_proxy.h index 6acfd75..b620f4a 100644 --- a/ppapi/proxy/ppb_url_request_info_proxy.h +++ b/ppapi/proxy/ppb_url_request_info_proxy.h @@ -10,7 +10,7 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/proxy/interface_proxy.h" -struct PPB_URLRequestInfo_Dev; +struct PPB_URLRequestInfo; namespace pp { namespace proxy { @@ -23,8 +23,8 @@ class PPB_URLRequestInfo_Proxy : public InterfaceProxy { const void* target_interface); virtual ~PPB_URLRequestInfo_Proxy(); - const PPB_URLRequestInfo_Dev* ppb_url_request_info_target() const { - return static_cast<const PPB_URLRequestInfo_Dev*>(target_interface()); + const PPB_URLRequestInfo* ppb_url_request_info_target() const { + return static_cast<const PPB_URLRequestInfo*>(target_interface()); } // InterfaceProxy implementation. diff --git a/ppapi/proxy/ppb_url_response_info_proxy.cc b/ppapi/proxy/ppb_url_response_info_proxy.cc index 2fbd452..c85150e 100644 --- a/ppapi/proxy/ppb_url_response_info_proxy.cc +++ b/ppapi/proxy/ppb_url_response_info_proxy.cc @@ -4,7 +4,7 @@ #include "ppapi/proxy/ppb_url_response_info_proxy.h" -#include "ppapi/c/dev/ppb_url_response_info_dev.h" +#include "ppapi/c/ppb_url_response_info.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_messages.h" @@ -32,7 +32,7 @@ PP_Bool IsURLResponseInfo(PP_Resource resource) { return BoolToPPBool(!!object); } -PP_Var GetProperty(PP_Resource response, PP_URLResponseProperty_Dev property) { +PP_Var GetProperty(PP_Resource response, PP_URLResponseProperty property) { Dispatcher* dispatcher = PluginDispatcher::Get(); ReceiveSerializedVarReturnValue result; dispatcher->Send(new PpapiHostMsg_PPBURLResponseInfo_GetProperty( @@ -40,11 +40,11 @@ PP_Var GetProperty(PP_Resource response, PP_URLResponseProperty_Dev property) { return result.Return(dispatcher); } -PP_Resource GetBody(PP_Resource response) { +PP_Resource GetBodyAsFileRef(PP_Resource response) { PP_Resource result = 0; /* Dispatcher* dispatcher = PluginDispatcher::Get(); - dispatcher->Send(new PpapiHostMsg_PPBURLResponseInfo_GetBody( + dispatcher->Send(new PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef( INTERFACE_ID_PPB_URL_RESPONSE_INFO, response, &result)); // TODO(brettw) when we have FileRef proxied, make an object from that // ref so we can track it properly and then uncomment this. @@ -52,10 +52,10 @@ PP_Resource GetBody(PP_Resource response) { return result; } -const PPB_URLResponseInfo_Dev ppb_urlresponseinfo = { +const PPB_URLResponseInfo ppb_urlresponseinfo = { &IsURLResponseInfo, &GetProperty, - &GetBody + &GetBodyAsFileRef }; } // namespace @@ -89,8 +89,8 @@ void PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty, OnMsgGetProperty) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBody, - OnMsgGetBody) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, + OnMsgGetBodyAsFileRef) IPC_END_MESSAGE_MAP() // TODO(brettw): handle bad messages. } @@ -100,12 +100,13 @@ void PPB_URLResponseInfo_Proxy::OnMsgGetProperty( int32_t property, SerializedVarReturnValue result) { result.Return(dispatcher(), ppb_url_response_info_target()->GetProperty( - response, static_cast<PP_URLResponseProperty_Dev>(property))); + response, static_cast<PP_URLResponseProperty>(property))); } -void PPB_URLResponseInfo_Proxy::OnMsgGetBody(PP_Resource response, - PP_Resource* file_ref_result) { - *file_ref_result = ppb_url_response_info_target()->GetBody(response); +void PPB_URLResponseInfo_Proxy::OnMsgGetBodyAsFileRef( + PP_Resource response, + PP_Resource* file_ref_result) { + *file_ref_result = ppb_url_response_info_target()->GetBodyAsFileRef(response); } } // namespace proxy diff --git a/ppapi/proxy/ppb_url_response_info_proxy.h b/ppapi/proxy/ppb_url_response_info_proxy.h index 639ddbe..423ca3e 100644 --- a/ppapi/proxy/ppb_url_response_info_proxy.h +++ b/ppapi/proxy/ppb_url_response_info_proxy.h @@ -10,7 +10,7 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/proxy/interface_proxy.h" -struct PPB_URLResponseInfo_Dev; +struct PPB_URLResponseInfo; namespace pp { namespace proxy { @@ -28,8 +28,8 @@ class PPB_URLResponseInfo_Proxy : public InterfaceProxy { // a response info object in the plugin. static void TrackPluginResource(PP_Resource response_resource); - const PPB_URLResponseInfo_Dev* ppb_url_response_info_target() const { - return static_cast<const PPB_URLResponseInfo_Dev*>(target_interface()); + const PPB_URLResponseInfo* ppb_url_response_info_target() const { + return static_cast<const PPB_URLResponseInfo*>(target_interface()); } // InterfaceProxy implementation. @@ -42,7 +42,8 @@ class PPB_URLResponseInfo_Proxy : public InterfaceProxy { void OnMsgGetProperty(PP_Resource response, int32_t property, SerializedVarReturnValue result); - void OnMsgGetBody(PP_Resource response, PP_Resource* file_ref_result); + void OnMsgGetBodyAsFileRef(PP_Resource response, + PP_Resource* file_ref_result); DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); }; diff --git a/ppapi/tests/test_c_includes.c b/ppapi/tests/test_c_includes.c index e17671f..80b221b2 100644 --- a/ppapi/tests/test_c_includes.c +++ b/ppapi/tests/test_c_includes.c @@ -25,6 +25,9 @@ #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_instance.h" +#include "ppapi/c/ppb_url_loader.h" +#include "ppapi/c/ppb_url_request_info.h" +#include "ppapi/c/ppb_url_response_info.h" #include "ppapi/c/ppb_var.h" #include "ppapi/c/ppp.h" #include "ppapi/c/ppp_instance.h" @@ -52,10 +55,6 @@ #include "ppapi/c/dev/ppb_scrollbar_dev.h" #include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_transport_dev.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" -#include "ppapi/c/dev/ppb_url_loader_trusted_dev.h" -#include "ppapi/c/dev/ppb_url_request_info_dev.h" -#include "ppapi/c/dev/ppb_url_response_info_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/dev/ppb_video_decoder_dev.h" @@ -71,4 +70,5 @@ #include "ppapi/c/dev/ppp_widget_dev.h" #include "ppapi/c/dev/ppp_zoom_dev.h" #include "ppapi/c/trusted/ppb_image_data_trusted.h" +#include "ppapi/c/trusted/ppb_url_loader_trusted.h" diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc index 513f5dd..e096903 100644 --- a/ppapi/tests/test_file_ref.cc +++ b/ppapi/tests/test_file_ref.cc @@ -12,11 +12,11 @@ #include "ppapi/cpp/dev/file_io_dev.h" #include "ppapi/cpp/dev/file_ref_dev.h" #include "ppapi/cpp/dev/file_system_dev.h" -#include "ppapi/cpp/dev/url_loader_dev.h" -#include "ppapi/cpp/dev/url_request_info_dev.h" -#include "ppapi/cpp/dev/url_response_info_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" +#include "ppapi/cpp/url_loader.h" +#include "ppapi/cpp/url_request_info.h" +#include "ppapi/cpp/url_response_info.h" #include "ppapi/tests/test_utils.h" #include "ppapi/tests/testing_instance.h" @@ -68,27 +68,27 @@ std::string TestFileRef::TestGetFileSystemType() { if (file_ref_temp.GetFileSystemType() != PP_FILESYSTEMTYPE_LOCALTEMPORARY) return "file_ref_temp expected to be temporary."; - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); request.SetStreamToFile(true); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return "URLLoader::Open() failed."; - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); if (status_code != 200) return "Unexpected HTTP status code"; - pp::FileRef_Dev file_ref_ext(response_info.GetBody()); + pp::FileRef_Dev file_ref_ext(response_info.GetBodyAsFileRef()); if (file_ref_ext.GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) return "file_ref_ext expected to be external."; @@ -117,27 +117,27 @@ std::string TestFileRef::TestGetName() { if (name != "/") return ReportMismatch("FileRef::GetName", name, "/"); - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); request.SetStreamToFile(true); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return "URLLoader::Open() failed."; - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); if (status_code != 200) return "Unexpected HTTP status code"; - pp::FileRef_Dev file_ref_ext(response_info.GetBody()); + pp::FileRef_Dev file_ref_ext(response_info.GetBodyAsFileRef()); name = file_ref_ext.GetName().AsString(); if (name != "") return ReportMismatch("FileRef::GetName", name, "<empty string>"); @@ -161,27 +161,27 @@ std::string TestFileRef::TestGetPath() { if (path != kTempFilePath) return ReportMismatch("FileRef::GetPath", path, kTempFilePath); - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); request.SetStreamToFile(true); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return "URLLoader::Open() failed."; - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); if (status_code != 200) return "Unexpected HTTP status code"; - pp::FileRef_Dev file_ref_ext(response_info.GetBody()); + pp::FileRef_Dev file_ref_ext(response_info.GetBodyAsFileRef()); if (!file_ref_ext.GetPath().is_undefined()) return "The path of an external FileRef should be void."; @@ -216,27 +216,27 @@ std::string TestFileRef::TestGetParent() { if (parent_path != "/") return ReportMismatch("FileRef::GetParent", parent_path, "/"); - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); request.SetStreamToFile(true); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return "URLLoader::Open() failed."; - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); if (status_code != 200) return "Unexpected HTTP status code"; - pp::FileRef_Dev file_ref_ext(response_info.GetBody()); + pp::FileRef_Dev file_ref_ext(response_info.GetBodyAsFileRef()); if (!file_ref_ext.GetParent().is_null()) return "The parent of an external FileRef should be null."; diff --git a/ppapi/tests/test_url_loader.cc b/ppapi/tests/test_url_loader.cc index 3203f39..f21a12a3 100644 --- a/ppapi/tests/test_url_loader.cc +++ b/ppapi/tests/test_url_loader.cc @@ -9,16 +9,16 @@ #include "ppapi/c/dev/ppb_file_io_dev.h" #include "ppapi/c/dev/ppb_testing_dev.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" #include "ppapi/c/pp_errors.h" +#include "ppapi/c/ppb_url_loader.h" #include "ppapi/cpp/dev/file_io_dev.h" #include "ppapi/cpp/dev/file_ref_dev.h" #include "ppapi/cpp/dev/file_system_dev.h" -#include "ppapi/cpp/dev/url_loader_dev.h" -#include "ppapi/cpp/dev/url_request_info_dev.h" -#include "ppapi/cpp/dev/url_response_info_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" +#include "ppapi/cpp/url_loader.h" +#include "ppapi/cpp/url_request_info.h" +#include "ppapi/cpp/url_response_info.h" #include "ppapi/tests/test_utils.h" #include "ppapi/tests/testing_instance.h" @@ -62,7 +62,7 @@ std::string TestURLLoader::ReadEntireFile(pp::FileIO_Dev* file_io, return ""; } -std::string TestURLLoader::ReadEntireResponseBody(pp::URLLoader_Dev* loader, +std::string TestURLLoader::ReadEntireResponseBody(pp::URLLoader* loader, std::string* body) { TestCompletionCallback callback; char buf[256]; @@ -82,18 +82,18 @@ std::string TestURLLoader::ReadEntireResponseBody(pp::URLLoader_Dev* loader, } std::string TestURLLoader::LoadAndCompareBody( - const pp::URLRequestInfo_Dev& request, + const pp::URLRequestInfo& request, const std::string& expected_body) { TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return ReportError("URLLoader::Open", rv); - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); @@ -114,13 +114,13 @@ std::string TestURLLoader::LoadAndCompareBody( } std::string TestURLLoader::TestBasicGET() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); return LoadAndCompareBody(request, "hello\n"); } std::string TestURLLoader::TestBasicPOST() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echo"); request.SetMethod("POST"); std::string postdata("postdata"); @@ -129,7 +129,7 @@ std::string TestURLLoader::TestBasicPOST() { } std::string TestURLLoader::TestCompoundBodyPOST() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echo"); request.SetMethod("POST"); std::string postdata1("post"); @@ -140,7 +140,7 @@ std::string TestURLLoader::TestCompoundBodyPOST() { } std::string TestURLLoader::TestEmptyDataPOST() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echo"); request.SetMethod("POST"); request.AppendDataToBody("", 0); @@ -148,7 +148,7 @@ std::string TestURLLoader::TestEmptyDataPOST() { } std::string TestURLLoader::TestBinaryDataPOST() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echo"); request.SetMethod("POST"); const char postdata_chars[] = @@ -160,14 +160,14 @@ std::string TestURLLoader::TestBinaryDataPOST() { } std::string TestURLLoader::TestCustomRequestHeader() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echoheader?Foo"); request.SetHeaders("Foo: 1"); return LoadAndCompareBody(request, "1"); } std::string TestURLLoader::TestIgnoresBogusContentLength() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("/echo"); request.SetMethod("POST"); request.SetHeaders("Content-Length: 400"); @@ -177,27 +177,27 @@ std::string TestURLLoader::TestIgnoresBogusContentLength() { } std::string TestURLLoader::TestStreamToFile() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("test_url_loader_data/hello.txt"); request.SetStreamToFile(true); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); if (rv != PP_OK) return ReportError("URLLoader::Open", rv); - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); if (status_code != 200) return "Unexpected HTTP status code"; - pp::FileRef_Dev body(response_info.GetBody()); + pp::FileRef_Dev body(response_info.GetBodyAsFileRef()); if (body.is_null()) return "URLResponseInfo::GetBody returned null"; @@ -234,12 +234,12 @@ std::string TestURLLoader::TestStreamToFile() { } std::string TestURLLoader::TestSameOriginRestriction() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; request.SetURL("http://www.google.com/"); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); @@ -259,14 +259,14 @@ std::string TestURLLoader::TestSameOriginRestriction() { // This test should cause a redirect and ensure that the loader runs // the callback, rather than following the redirect. std::string TestURLLoader::TestAuditURLRedirect() { - pp::URLRequestInfo_Dev request; + pp::URLRequestInfo request; // This path will cause the server to return a 301 redirect. request.SetURL("/server-redirect?www.google.com"); request.SetFollowRedirects(false); TestCompletionCallback callback; - pp::URLLoader_Dev loader(*instance_); + pp::URLLoader loader(*instance_); int32_t rv = loader.Open(request, callback); if (rv == PP_ERROR_WOULDBLOCK) rv = callback.WaitForResult(); @@ -275,7 +275,7 @@ std::string TestURLLoader::TestAuditURLRedirect() { // Checks that the response indicates a redirect, and that the URL // is correct. - pp::URLResponseInfo_Dev response_info(loader.GetResponseInfo()); + pp::URLResponseInfo response_info(loader.GetResponseInfo()); if (response_info.is_null()) return "URLLoader::GetResponseInfo returned null"; int32_t status_code = response_info.GetStatusCode(); diff --git a/ppapi/tests/test_url_loader.h b/ppapi/tests/test_url_loader.h index 681016d..944868f 100644 --- a/ppapi/tests/test_url_loader.h +++ b/ppapi/tests/test_url_loader.h @@ -11,8 +11,8 @@ namespace pp { class FileIO_Dev; -class URLLoader_Dev; -class URLRequestInfo_Dev; +class URLLoader; +class URLRequestInfo; } class TestURLLoader : public TestCase { @@ -25,9 +25,9 @@ class TestURLLoader : public TestCase { private: std::string ReadEntireFile(pp::FileIO_Dev* file_io, std::string* data); - std::string ReadEntireResponseBody(pp::URLLoader_Dev* loader, + std::string ReadEntireResponseBody(pp::URLLoader* loader, std::string* body); - std::string LoadAndCompareBody(const pp::URLRequestInfo_Dev& request, + std::string LoadAndCompareBody(const pp::URLRequestInfo& request, const std::string& expected_body); std::string TestBasicGET(); diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc index cf17813..b7bad9f 100644 --- a/webkit/glue/plugins/pepper_plugin_module.cc +++ b/webkit/glue/plugins/pepper_plugin_module.cc @@ -27,16 +27,11 @@ #include "ppapi/c/dev/ppb_scrollbar_dev.h" #include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_transport_dev.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" -#include "ppapi/c/dev/ppb_url_loader_trusted_dev.h" -#include "ppapi/c/dev/ppb_url_request_info_dev.h" -#include "ppapi/c/dev/ppb_url_response_info_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/dev/ppb_video_decoder_dev.h" #include "ppapi/c/dev/ppb_widget_dev.h" #include "ppapi/c/dev/ppb_zoom_dev.h" -#include "ppapi/c/trusted/ppb_image_data_trusted.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_var.h" @@ -45,9 +40,14 @@ #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_instance.h" +#include "ppapi/c/ppb_url_loader.h" +#include "ppapi/c/ppb_url_request_info.h" +#include "ppapi/c/ppb_url_response_info.h" #include "ppapi/c/ppb_var.h" #include "ppapi/c/ppp.h" #include "ppapi/c/ppp_instance.h" +#include "ppapi/c/trusted/ppb_image_data_trusted.h" +#include "ppapi/c/trusted/ppb_url_loader_trusted.h" #include "ppapi/proxy/host_dispatcher.h" #include "ppapi/proxy/ppapi_messages.h" #include "webkit/glue/plugins/pepper_audio.h" @@ -233,13 +233,13 @@ const void* GetInterface(const char* name) { #endif // ENABLE_GPU if (strcmp(name, PPB_TRANSPORT_DEV_INTERFACE) == 0) return Transport::GetInterface(); - if (strcmp(name, PPB_URLLOADER_DEV_INTERFACE) == 0) + if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0) return URLLoader::GetInterface(); - if (strcmp(name, PPB_URLLOADERTRUSTED_DEV_INTERFACE) == 0) + if (strcmp(name, PPB_URLLOADERTRUSTED_INTERFACE) == 0) return URLLoader::GetTrustedInterface(); - if (strcmp(name, PPB_URLREQUESTINFO_DEV_INTERFACE) == 0) + if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0) return URLRequestInfo::GetInterface(); - if (strcmp(name, PPB_URLRESPONSEINFO_DEV_INTERFACE) == 0) + if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0) return URLResponseInfo::GetInterface(); if (strcmp(name, PPB_BUFFER_DEV_INTERFACE) == 0) return Buffer::GetInterface(); diff --git a/webkit/glue/plugins/pepper_url_loader.cc b/webkit/glue/plugins/pepper_url_loader.cc index c9a580a..20be805 100644 --- a/webkit/glue/plugins/pepper_url_loader.cc +++ b/webkit/glue/plugins/pepper_url_loader.cc @@ -7,8 +7,8 @@ #include "base/logging.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/c/dev/ppb_url_loader_dev.h" -#include "ppapi/c/dev/ppb_url_loader_trusted_dev.h" +#include "ppapi/c/ppb_url_loader.h" +#include "ppapi/c/trusted/ppb_url_loader_trusted.h" #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" @@ -142,7 +142,7 @@ void Close(PP_Resource loader_id) { loader->Close(); } -const PPB_URLLoader_Dev ppb_urlloader = { +const PPB_URLLoader ppb_urlloader = { &Create, &IsURLLoader, &Open, @@ -171,7 +171,7 @@ void SetStatusCallback(PP_Resource loader_id, loader->SetStatusCallback(cb); } -const PPB_URLLoaderTrusted_Dev ppb_urlloadertrusted = { +const PPB_URLLoaderTrusted ppb_urlloadertrusted = { &GrantUniversalAccess, &SetStatusCallback }; @@ -207,12 +207,12 @@ URLLoader::~URLLoader() { } // static -const PPB_URLLoader_Dev* URLLoader::GetInterface() { +const PPB_URLLoader* URLLoader::GetInterface() { return &ppb_urlloader; } // static -const PPB_URLLoaderTrusted_Dev* URLLoader::GetTrustedInterface() { +const PPB_URLLoaderTrusted* URLLoader::GetTrustedInterface() { return &ppb_urlloadertrusted; } diff --git a/webkit/glue/plugins/pepper_url_loader.h b/webkit/glue/plugins/pepper_url_loader.h index dd91708..22adb6c 100644 --- a/webkit/glue/plugins/pepper_url_loader.h +++ b/webkit/glue/plugins/pepper_url_loader.h @@ -9,13 +9,13 @@ #include "base/scoped_ptr.h" #include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/dev/ppb_url_loader_trusted_dev.h" +#include "ppapi/c/trusted/ppb_url_loader_trusted.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" #include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_resource.h" -struct PPB_URLLoader_Dev; -struct PPB_URLLoaderTrusted_Dev; +struct PPB_URLLoader; +struct PPB_URLLoaderTrusted; namespace WebKit { class WebFrame; @@ -37,11 +37,11 @@ class URLLoader : public Resource, // Returns a pointer to the interface implementing PPB_URLLoader that is // exposed to the plugin. - static const PPB_URLLoader_Dev* GetInterface(); + static const PPB_URLLoader* GetInterface(); // Returns a pointer to the interface implementing PPB_URLLoaderTrusted that // is exposed to the plugin. - static const PPB_URLLoaderTrusted_Dev* GetTrustedInterface(); + static const PPB_URLLoaderTrusted* GetTrustedInterface(); // Resource overrides. URLLoader* AsURLLoader() { return this; } diff --git a/webkit/glue/plugins/pepper_url_request_info.cc b/webkit/glue/plugins/pepper_url_request_info.cc index ae0c280..f606509 100644 --- a/webkit/glue/plugins/pepper_url_request_info.cc +++ b/webkit/glue/plugins/pepper_url_request_info.cc @@ -62,7 +62,7 @@ PP_Bool IsURLRequestInfo(PP_Resource resource) { } PP_Bool SetProperty(PP_Resource request_id, - PP_URLRequestProperty_Dev property, + PP_URLRequestProperty property, PP_Var var) { scoped_refptr<URLRequestInfo> request( Resource::GetAs<URLRequestInfo>(request_id)); @@ -117,7 +117,7 @@ PP_Bool AppendFileToBody(PP_Resource request_id, expected_last_modified_time)); } -const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { +const PPB_URLRequestInfo ppb_urlrequestinfo = { &Create, &IsURLRequestInfo, &SetProperty, @@ -164,11 +164,11 @@ URLRequestInfo::~URLRequestInfo() { } // static -const PPB_URLRequestInfo_Dev* URLRequestInfo::GetInterface() { +const PPB_URLRequestInfo* URLRequestInfo::GetInterface() { return &ppb_urlrequestinfo; } -bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty_Dev property, +bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty property, bool value) { switch (property) { case PP_URLREQUESTPROPERTY_STREAMTOFILE: @@ -189,7 +189,7 @@ bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty_Dev property, } } -bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty_Dev property, +bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty property, const std::string& value) { // TODO(darin): Validate input. Perhaps at a different layer? switch (property) { diff --git a/webkit/glue/plugins/pepper_url_request_info.h b/webkit/glue/plugins/pepper_url_request_info.h index 4fd4e26..7aa9fc1 100644 --- a/webkit/glue/plugins/pepper_url_request_info.h +++ b/webkit/glue/plugins/pepper_url_request_info.h @@ -9,7 +9,7 @@ #include <vector> #include "base/ref_counted.h" -#include "ppapi/c/dev/ppb_url_request_info_dev.h" +#include "ppapi/c/ppb_url_request_info.h" #include "webkit/glue/plugins/pepper_file_ref.h" #include "webkit/glue/plugins/pepper_resource.h" @@ -27,14 +27,14 @@ class URLRequestInfo : public Resource { // Returns a pointer to the interface implementing PPB_URLRequestInfo that is // exposed to the plugin. - static const PPB_URLRequestInfo_Dev* GetInterface(); + static const PPB_URLRequestInfo* GetInterface(); // Resource overrides. URLRequestInfo* AsURLRequestInfo() { return this; } // PPB_URLRequestInfo implementation. - bool SetBooleanProperty(PP_URLRequestProperty_Dev property, bool value); - bool SetStringProperty(PP_URLRequestProperty_Dev property, + bool SetBooleanProperty(PP_URLRequestProperty property, bool value); + bool SetStringProperty(PP_URLRequestProperty property, const std::string& value); bool AppendDataToBody(const std::string& data); bool AppendFileToBody(FileRef* file_ref, diff --git a/webkit/glue/plugins/pepper_url_response_info.cc b/webkit/glue/plugins/pepper_url_response_info.cc index 2e7202f..5ae484f 100644 --- a/webkit/glue/plugins/pepper_url_response_info.cc +++ b/webkit/glue/plugins/pepper_url_response_info.cc @@ -44,7 +44,7 @@ PP_Bool IsURLResponseInfo(PP_Resource resource) { } PP_Var GetProperty(PP_Resource response_id, - PP_URLResponseProperty_Dev property) { + PP_URLResponseProperty property) { scoped_refptr<URLResponseInfo> response( Resource::GetAs<URLResponseInfo>(response_id)); if (!response) @@ -67,7 +67,7 @@ PP_Resource GetBody(PP_Resource response_id) { return body->GetReference(); } -const PPB_URLResponseInfo_Dev ppb_urlresponseinfo = { +const PPB_URLResponseInfo ppb_urlresponseinfo = { &IsURLResponseInfo, &GetProperty, &GetBody @@ -88,11 +88,11 @@ URLResponseInfo::~URLResponseInfo() { } // static -const PPB_URLResponseInfo_Dev* URLResponseInfo::GetInterface() { +const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { return &ppb_urlresponseinfo; } -PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty_Dev property) { +PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { switch (property) { case PP_URLRESPONSEPROPERTY_URL: return StringVar::StringToPPVar(module(), url_); diff --git a/webkit/glue/plugins/pepper_url_response_info.h b/webkit/glue/plugins/pepper_url_response_info.h index ff3a832..adbf8ef 100644 --- a/webkit/glue/plugins/pepper_url_response_info.h +++ b/webkit/glue/plugins/pepper_url_response_info.h @@ -7,7 +7,7 @@ #include <string> -#include "ppapi/c/dev/ppb_url_response_info_dev.h" +#include "ppapi/c/ppb_url_response_info.h" #include "webkit/glue/plugins/pepper_resource.h" namespace WebKit { @@ -23,13 +23,13 @@ class URLResponseInfo : public Resource { // Returns a pointer to the interface implementing PPB_URLResponseInfo that // is exposed to the plugin. - static const PPB_URLResponseInfo_Dev* GetInterface(); + static const PPB_URLResponseInfo* GetInterface(); // Resource overrides. URLResponseInfo* AsURLResponseInfo() { return this; } // PPB_URLResponseInfo implementation. - PP_Var GetProperty(PP_URLResponseProperty_Dev property); + PP_Var GetProperty(PP_URLResponseProperty property); bool Initialize(const WebKit::WebURLResponse& response); |