summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authormgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 07:38:33 +0000
committermgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 07:38:33 +0000
commit29b8f2312c189bd8394ea13e5063acfe9c395507 (patch)
tree57fffd40ef4a0286d15dabc93f81bb86c8ffcd95 /ppapi/proxy
parent8b5cd4ec8654fc5db76765ff1ffb6f4d9ee23e7e (diff)
downloadchromium_src-29b8f2312c189bd8394ea13e5063acfe9c395507.zip
chromium_src-29b8f2312c189bd8394ea13e5063acfe9c395507.tar.gz
chromium_src-29b8f2312c189bd8394ea13e5063acfe9c395507.tar.bz2
[PPAPI] ResourceVar now holds a pending renderer and browser host ID.
It is likely that resources will be backed by a host in the renderer or browser, or both. Therefore, HostResourceVar should provide a consistent way to tell the plugin the pending host IDs. BUG=177017 Review URL: https://codereview.chromium.org/24196005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/raw_var_data.cc14
-rw-r--r--ppapi/proxy/raw_var_data.h6
2 files changed, 18 insertions, 2 deletions
diff --git a/ppapi/proxy/raw_var_data.cc b/ppapi/proxy/raw_var_data.cc
index 337eaae..91bcfbfd 100644
--- a/ppapi/proxy/raw_var_data.cc
+++ b/ppapi/proxy/raw_var_data.cc
@@ -665,8 +665,10 @@ bool DictionaryRawVarData::Read(PP_VarType type,
}
// ResourceRawVarData ----------------------------------------------------------
-ResourceRawVarData::ResourceRawVarData() {
-}
+ResourceRawVarData::ResourceRawVarData()
+ : pp_resource_(0),
+ pending_renderer_host_id_(0),
+ pending_browser_host_id_(0) {}
ResourceRawVarData::~ResourceRawVarData() {
}
@@ -686,6 +688,8 @@ bool ResourceRawVarData::Init(const PP_Var& var, PP_Instance /*instance*/) {
creation_message_.reset(new IPC::Message(*message));
else
creation_message_.reset();
+ pending_renderer_host_id_ = resource_var->GetPendingRendererHostId();
+ pending_browser_host_id_ = resource_var->GetPendingBrowserHostId();
initialized_ = true;
return true;
}
@@ -708,6 +712,8 @@ void ResourceRawVarData::PopulatePPVar(const PP_Var& var,
void ResourceRawVarData::Write(IPC::Message* m,
const HandleWriter& handle_writer) {
m->WriteInt(static_cast<int>(pp_resource_));
+ m->WriteInt(pending_renderer_host_id_);
+ m->WriteInt(pending_browser_host_id_);
m->WriteBool(creation_message_);
if (creation_message_)
IPC::ParamTraits<IPC::Message>::Write(m, *creation_message_);
@@ -720,6 +726,10 @@ bool ResourceRawVarData::Read(PP_VarType type,
if (!m->ReadInt(iter, &value))
return false;
pp_resource_ = static_cast<PP_Resource>(value);
+ if (!m->ReadInt(iter, &pending_renderer_host_id_))
+ return false;
+ if (!m->ReadInt(iter, &pending_browser_host_id_))
+ return false;
bool has_creation_message;
if (!m->ReadBool(iter, &has_creation_message))
return false;
diff --git a/ppapi/proxy/raw_var_data.h b/ppapi/proxy/raw_var_data.h
index 201da2c..d45ea53 100644
--- a/ppapi/proxy/raw_var_data.h
+++ b/ppapi/proxy/raw_var_data.h
@@ -283,6 +283,12 @@ class ResourceRawVarData : public RawVarData {
// This is a borrowed reference; the resource's refcount is not incremented.
PP_Resource pp_resource_;
+ // Pending resource host ID in the renderer.
+ int pending_renderer_host_id_;
+
+ // Pending resource host ID in the browser.
+ int pending_browser_host_id_;
+
// A message containing information about how to create a plugin-side
// resource. The message type will vary based on the resource type, and will
// usually contain a pending resource host ID, and other required information.