| Index: webkit/plugins/ppapi/ppb_url_response_info_impl.cc
|
| ===================================================================
|
| --- webkit/plugins/ppapi/ppb_url_response_info_impl.cc (revision 0)
|
| +++ webkit/plugins/ppapi/ppb_url_response_info_impl.cc (working copy)
|
| @@ -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 "webkit/glue/plugins/pepper_url_response_info.h"
|
| +#include "webkit/plugins/ppapi/ppb_url_response_info_impl.h"
|
|
|
| #include "base/logging.h"
|
| #include "ppapi/c/pp_var.h"
|
| @@ -10,16 +10,17 @@
|
| #include "third_party/WebKit/WebKit/chromium/public/WebString.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
|
| -#include "webkit/glue/plugins/pepper_common.h"
|
| -#include "webkit/glue/plugins/pepper_file_ref.h"
|
| -#include "webkit/glue/plugins/pepper_var.h"
|
| +#include "webkit/plugins/ppapi/common.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
|
| +#include "webkit/plugins/ppapi/var.h"
|
| #include "webkit/glue/webkit_glue.h"
|
|
|
| using WebKit::WebHTTPHeaderVisitor;
|
| using WebKit::WebString;
|
| using WebKit::WebURLResponse;
|
|
|
| -namespace pepper {
|
| +namespace webkit {
|
| +namespace ppapi {
|
|
|
| namespace {
|
|
|
| @@ -40,13 +41,13 @@
|
| };
|
|
|
| PP_Bool IsURLResponseInfo(PP_Resource resource) {
|
| - return BoolToPPBool(!!Resource::GetAs<URLResponseInfo>(resource));
|
| + return BoolToPPBool(!!Resource::GetAs<PPB_URLResponseInfo_Impl>(resource));
|
| }
|
|
|
| PP_Var GetProperty(PP_Resource response_id,
|
| PP_URLResponseProperty property) {
|
| - scoped_refptr<URLResponseInfo> response(
|
| - Resource::GetAs<URLResponseInfo>(response_id));
|
| + scoped_refptr<PPB_URLResponseInfo_Impl> response(
|
| + Resource::GetAs<PPB_URLResponseInfo_Impl>(response_id));
|
| if (!response)
|
| return PP_MakeUndefined();
|
|
|
| @@ -54,12 +55,12 @@
|
| }
|
|
|
| PP_Resource GetBody(PP_Resource response_id) {
|
| - scoped_refptr<URLResponseInfo> response(
|
| - Resource::GetAs<URLResponseInfo>(response_id));
|
| + scoped_refptr<PPB_URLResponseInfo_Impl> response(
|
| + Resource::GetAs<PPB_URLResponseInfo_Impl>(response_id));
|
| if (!response.get())
|
| return 0;
|
|
|
| - FileRef* body = response->body();
|
| + PPB_FileRef_Impl* body = response->body();
|
| if (!body)
|
| return 0;
|
| body->AddRef(); // AddRef for the caller.
|
| @@ -79,24 +80,25 @@
|
|
|
| } // namespace
|
|
|
| -URLResponseInfo::URLResponseInfo(PluginModule* module)
|
| +PPB_URLResponseInfo_Impl::PPB_URLResponseInfo_Impl(PluginModule* module)
|
| : Resource(module),
|
| status_code_(-1) {
|
| }
|
|
|
| -URLResponseInfo::~URLResponseInfo() {
|
| +PPB_URLResponseInfo_Impl::~PPB_URLResponseInfo_Impl() {
|
| }
|
|
|
| // static
|
| -const PPB_URLResponseInfo* URLResponseInfo::GetInterface() {
|
| +const PPB_URLResponseInfo* PPB_URLResponseInfo_Impl::GetInterface() {
|
| return &ppb_urlresponseinfo;
|
| }
|
|
|
| -URLResponseInfo* URLResponseInfo::AsURLResponseInfo() {
|
| +PPB_URLResponseInfo_Impl*
|
| +PPB_URLResponseInfo_Impl::AsPPB_URLResponseInfo_Impl() {
|
| return this;
|
| }
|
|
|
| -PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) {
|
| +PP_Var PPB_URLResponseInfo_Impl::GetProperty(PP_URLResponseProperty property) {
|
| switch (property) {
|
| case PP_URLRESPONSEPROPERTY_URL:
|
| return StringVar::StringToPPVar(module(), url_);
|
| @@ -119,7 +121,7 @@
|
| return PP_MakeUndefined();
|
| }
|
|
|
| -bool URLResponseInfo::Initialize(const WebURLResponse& response) {
|
| +bool PPB_URLResponseInfo_Impl::Initialize(const WebURLResponse& response) {
|
| url_ = response.url().spec();
|
| status_code_ = response.httpStatusCode();
|
| status_text_ = response.httpStatusText().utf8();
|
| @@ -134,8 +136,11 @@
|
|
|
| WebString file_path = response.downloadFilePath();
|
| if (!file_path.isEmpty())
|
| - body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path));
|
| + body_ = new PPB_FileRef_Impl(module(),
|
| + webkit_glue::WebStringToFilePath(file_path));
|
| return true;
|
| }
|
|
|
| -} // namespace pepper
|
| +} // namespace ppapi
|
| +} // namespace webkit
|
| +
|
|
|