summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_file_ref_proxy.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 16:54:22 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 16:54:22 +0000
commitcc6db92524420397e246af1ed1b07258ded14e30 (patch)
tree5cd8ffb89c17dece4d2a4ba4fd7e137fff6ece1c /ppapi/proxy/ppb_file_ref_proxy.cc
parent854f39b3dd8619365ee75abdd9d9e25d4397f14a (diff)
downloadchromium_src-cc6db92524420397e246af1ed1b07258ded14e30.zip
chromium_src-cc6db92524420397e246af1ed1b07258ded14e30.tar.gz
chromium_src-cc6db92524420397e246af1ed1b07258ded14e30.tar.bz2
Implement a proxy for Pepper FileIO.
[ Reland of 113565 http://codereview.chromium.org/8764003 ] This splits apart the old in-process implementation into a new object in shared_impl that does most of the general tracking. This alllows that code to be shared by the proxy. BUG=http://crbug.com/101154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_file_ref_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_file_ref_proxy.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_file_ref_proxy.cc b/ppapi/proxy/ppb_file_ref_proxy.cc
index 20b522c..e481f86 100644
--- a/ppapi/proxy/ppb_file_ref_proxy.cc
+++ b/ppapi/proxy/ppb_file_ref_proxy.cc
@@ -33,6 +33,9 @@ class FileRef : public PPB_FileRef_Shared {
explicit FileRef(const PPB_FileRef_CreateInfo& info);
virtual ~FileRef();
+ // Resource overrides.
+ virtual void LastPluginRefWasDeleted() OVERRIDE;
+
// PPB_FileRef_API implementation (not provided by PPB_FileRef_Shared).
virtual PP_Resource GetParent() OVERRIDE;
virtual int32_t MakeDirectory(PP_Bool make_ancestors,
@@ -77,6 +80,11 @@ FileRef::FileRef(const PPB_FileRef_CreateInfo& info)
}
FileRef::~FileRef() {
+ // The callbacks map should have been cleared by LastPluginRefWasDeleted.
+ DCHECK(pending_callbacks_.empty());
+}
+
+void FileRef::LastPluginRefWasDeleted() {
// Abort all pending callbacks. Do this by posting a task to avoid reentering
// the plugin's Release() call that probably deleted this object.
for (PendingCallbackMap::iterator i = pending_callbacks_.begin();
@@ -85,6 +93,7 @@ FileRef::~FileRef() {
i->second.func, i->second.user_data,
static_cast<int32_t>(PP_ERROR_ABORTED)));
}
+ pending_callbacks_.clear();
}
PP_Resource FileRef::GetParent() {