Chromium Code Reviews| Index: ppapi/proxy/file_system_resource.cc |
| diff --git a/ppapi/proxy/file_system_resource.cc b/ppapi/proxy/file_system_resource.cc |
| index 18399301309ae10ba0274b91d5602279fe3e9f93..b2ed595c488cb6c0eb96c4abbc85c1d5c6338717 100644 |
| --- a/ppapi/proxy/file_system_resource.cc |
| +++ b/ppapi/proxy/file_system_resource.cc |
| @@ -21,7 +21,8 @@ FileSystemResource::FileSystemResource(Connection connection, |
| : PluginResource(connection, instance), |
| type_(type), |
| called_open_(false), |
| - callback_count_(0) { |
| + callback_count_(0), |
| + callback_result_(PP_OK) { |
| DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); |
| SendCreate(RENDERER, PpapiHostMsg_FileSystem_Create(type_)); |
| SendCreate(BROWSER, PpapiHostMsg_FileSystem_Create(type_)); |
| @@ -34,7 +35,9 @@ FileSystemResource::FileSystemResource(Connection connection, |
| PP_FileSystemType type) |
| : PluginResource(connection, instance), |
| type_(type), |
| - called_open_(true) { |
| + called_open_(true), |
| + callback_count_(0), |
| + callback_result_(PP_OK) { |
| DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); |
| AttachToPendingHost(RENDERER, pending_renderer_id); |
| AttachToPendingHost(BROWSER, pending_browser_id); |
| @@ -99,18 +102,22 @@ void FileSystemResource::OpenComplete( |
| scoped_refptr<TrackedCallback> callback, |
| const ResourceMessageReplyParams& params) { |
| ++callback_count_; |
| + if (params.result() != PP_OK) |
| + callback_result_ = params.result(); |
|
teravest
2013/11/12 18:04:53
Thanks for cleaning this up.
|
| // Received callback from browser and renderer. |
| if (callback_count_ == 2) |
| - callback->Run(params.result()); |
| + callback->Run(callback_result_); |
| } |
| void FileSystemResource::InitIsolatedFileSystemComplete( |
| const base::Callback<void(int32_t)>& callback, |
| const ResourceMessageReplyParams& params) { |
| ++callback_count_; |
| + if (params.result() != PP_OK) |
| + callback_result_ = params.result(); |
| // Received callback from browser and renderer. |
| if (callback_count_ == 2) |
| - callback.Run(params.result()); |
| + callback.Run(callback_result_); |
| } |
| } // namespace proxy |