Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2852)

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 10541113: Notify CloseFile from Pepper to FileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 0a30831cb9579dad251ccd12617d4eeee39d67bd..fcf0ee1fd738d1fdb3adcc15c1c23df5aac5c423 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -193,6 +193,8 @@ class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget {
webkit::ppapi::PluginInstance* plugin_;
};
+void DoNothing() {}
+
} // namespace
PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderViewImpl* render_view)
@@ -912,6 +914,20 @@ bool PepperPluginDelegateImpl::AsyncOpenFileSystemURL(
new AsyncOpenFileSystemURLCallbackTranslator(callback));
}
+bool PepperPluginDelegateImpl::AsyncNotifyCloseFileSystemURL(const GURL& path) {
+ // Schedule the notification task in the file thread, to make sure that the
+ // actual close operation has finished.
+ return GetFileThreadMessageLoopProxy()->PostTaskAndReply(
+ FROM_HERE,
+ base::Bind(&DoNothing),
+ base::Bind(&PepperPluginDelegateImpl::DoNotifyCloseFile,
+ AsWeakPtr(), path));
kinuko 2012/06/13 06:38:29 What happens if the plugin goes away before this i
kinaba 2012/06/25 11:14:02 PepperPluginDelegateImpl is associated with a rend
+}
+
+void PepperPluginDelegateImpl::DoNotifyCloseFile(const GURL& path) {
+ ChildThread::current()->file_system_dispatcher()->NotifyCloseFile(path);
+}
+
base::PlatformFileError PepperPluginDelegateImpl::OpenFile(
const ppapi::PepperFilePath& path,
int flags,

Powered by Google App Engine
This is Rietveld 408576698