summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 04:51:07 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 04:51:07 +0000
commit6f75c95235c7ea357e180ddfb6d1cba143d87645 (patch)
treee5440672cfbe6bac4d28f6790ab1c5b4ee8b3f93 /ppapi/thunk
parentecba6c3763755a5c617972d74f0d798939183260 (diff)
downloadchromium_src-6f75c95235c7ea357e180ddfb6d1cba143d87645.zip
chromium_src-6f75c95235c7ea357e180ddfb6d1cba143d87645.tar.gz
chromium_src-6f75c95235c7ea357e180ddfb6d1cba143d87645.tar.bz2
Convert FileRefImpl and URLRequestInfo to shared_impl.
One nice side effect of this change is that there are no longer any IPCs associated with the request info. Instead, we just send the parameters to the host when we open a url loader. Review URL: http://codereview.chromium.org/7706021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/enter.h9
-rw-r--r--ppapi/thunk/ppb_file_ref_api.h7
-rw-r--r--ppapi/thunk/ppb_url_request_info_api.h6
-rw-r--r--ppapi/thunk/ppb_url_request_info_thunk.cc4
-rw-r--r--ppapi/thunk/resource_creation_api.h7
5 files changed, 27 insertions, 6 deletions
diff --git a/ppapi/thunk/enter.h b/ppapi/thunk/enter.h
index e7f0d0f..e83a1a1 100644
--- a/ppapi/thunk/enter.h
+++ b/ppapi/thunk/enter.h
@@ -97,10 +97,9 @@ class EnterResource {
public:
EnterResource(PP_Resource resource, bool report_error)
: object_(NULL) {
- Resource* base =
- TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
- if (base)
- object_ = base->GetAs<ResourceT>();
+ resource_ = TrackerBase::Get()->GetResourceTracker()->GetResource(resource);
+ if (resource_)
+ object_ = resource_->GetAs<ResourceT>();
// TODO(brettw) check error and if report_error is set, do something.
}
~EnterResource() {}
@@ -109,8 +108,10 @@ class EnterResource {
bool failed() const { return !object_; }
ResourceT* object() { return object_; }
+ Resource* resource() { return resource_; }
private:
+ Resource* resource_;
ResourceT* object_;
DISALLOW_COPY_AND_ASSIGN(EnterResource);
diff --git a/ppapi/thunk/ppb_file_ref_api.h b/ppapi/thunk/ppb_file_ref_api.h
index be46cef..b2f0e9d 100644
--- a/ppapi/thunk/ppb_file_ref_api.h
+++ b/ppapi/thunk/ppb_file_ref_api.h
@@ -8,6 +8,9 @@
#include "ppapi/c/ppb_file_ref.h"
namespace ppapi {
+
+struct PPB_FileRef_CreateInfo;
+
namespace thunk {
class PPB_FileRef_API {
@@ -26,6 +29,10 @@ class PPB_FileRef_API {
virtual int32_t Delete(PP_CompletionCallback callback) = 0;
virtual int32_t Rename(PP_Resource new_file_ref,
PP_CompletionCallback callback) = 0;
+
+ // Intermal function for use in proxying. Returns the internal CreateInfo
+ // (the contained resource does not carry a ref on behalf of the caller).
+ virtual const PPB_FileRef_CreateInfo& GetCreateInfo() const = 0;
};
} // namespace thunk
diff --git a/ppapi/thunk/ppb_url_request_info_api.h b/ppapi/thunk/ppb_url_request_info_api.h
index 3f6d0ed..56634bc 100644
--- a/ppapi/thunk/ppb_url_request_info_api.h
+++ b/ppapi/thunk/ppb_url_request_info_api.h
@@ -8,6 +8,9 @@
#include "ppapi/c/ppb_url_request_info.h"
namespace ppapi {
+
+struct PPB_URLRequestInfo_Data;
+
namespace thunk {
class PPB_URLRequestInfo_API {
@@ -21,6 +24,9 @@ class PPB_URLRequestInfo_API {
int64_t start_offset,
int64_t number_of_bytes,
PP_Time expected_last_modified_time) = 0;
+
+ // Internal-only function for retrieving the current config.
+ virtual const PPB_URLRequestInfo_Data& GetData() const = 0;
};
} // namespace thunk
diff --git a/ppapi/thunk/ppb_url_request_info_thunk.cc b/ppapi/thunk/ppb_url_request_info_thunk.cc
index 5c99d18..4f41881 100644
--- a/ppapi/thunk/ppb_url_request_info_thunk.cc
+++ b/ppapi/thunk/ppb_url_request_info_thunk.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ppapi/shared_impl/url_request_info_impl.h"
#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_url_request_info_api.h"
@@ -16,7 +17,8 @@ PP_Resource Create(PP_Instance instance) {
EnterFunction<ResourceCreationAPI> enter(instance, true);
if (enter.failed())
return 0;
- return enter.functions()->CreateURLRequestInfo(instance);
+ return enter.functions()->CreateURLRequestInfo(
+ instance, PPB_URLRequestInfo_Data());
}
PP_Bool IsURLRequestInfo(PP_Resource resource) {
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index 948a1dd..5564eec 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -24,6 +24,9 @@ struct PP_VideoCaptureDeviceInfo_Dev;
struct PP_Size;
namespace ppapi {
+
+struct PPB_URLRequestInfo_Data;
+
namespace thunk {
// A functional API for creating resource types. Separating out the creation
@@ -108,7 +111,9 @@ class ResourceCreationAPI {
const char* name,
const char* proto) = 0;
virtual PP_Resource CreateURLLoader(PP_Instance instance) = 0;
- virtual PP_Resource CreateURLRequestInfo(PP_Instance instance) = 0;
+ virtual PP_Resource CreateURLRequestInfo(
+ PP_Instance instance,
+ const PPB_URLRequestInfo_Data& data) = 0;
virtual PP_Resource CreateVideoCapture(PP_Instance instance) = 0;
virtual PP_Resource CreateVideoDecoder(
PP_Instance instance,