Chromium Code Reviews| 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, |