Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/proxy/isolated_file_system_private_resource.h" | 5 #include "ppapi/proxy/isolated_file_system_private_resource.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/c/pp_file_info.h" | 10 #include "ppapi/c/pp_file_info.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 } | 40 } |
| 41 | 41 |
| 42 int32_t IsolatedFileSystemPrivateResource::Open( | 42 int32_t IsolatedFileSystemPrivateResource::Open( |
| 43 PP_Instance /* unused */, | 43 PP_Instance /* unused */, |
| 44 PP_IsolatedFileSystemType_Private type, | 44 PP_IsolatedFileSystemType_Private type, |
| 45 PP_Resource* file_system_resource, | 45 PP_Resource* file_system_resource, |
| 46 scoped_refptr<TrackedCallback> callback) { | 46 scoped_refptr<TrackedCallback> callback) { |
| 47 if (!file_system_resource) | 47 if (!file_system_resource) |
| 48 return PP_ERROR_BADARGUMENT; | 48 return PP_ERROR_BADARGUMENT; |
| 49 | 49 |
| 50 #ifndef OS_CHROMEOS | |
| 51 // PluginPrivate filesystem is supported only on ChromeOS. | |
|
dmichael (off chromium)
2013/11/15 17:42:44
Thanks. I think we want to actually check this on
nhiroki
2013/11/18 11:21:17
Good to know. I considered this closely, and I thi
| |
| 52 if (type == PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE) { | |
| 53 LOG(WARNING) << "PluginPrivate filesystem is not supported."; | |
| 54 return PP_ERROR_NOTSUPPORTED; | |
| 55 } | |
| 56 #endif | |
| 57 | |
| 50 Call<PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply>(BROWSER, | 58 Call<PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply>(BROWSER, |
| 51 PpapiHostMsg_IsolatedFileSystem_BrowserOpen(type), | 59 PpapiHostMsg_IsolatedFileSystem_BrowserOpen(type), |
| 52 base::Bind(&IsolatedFileSystemPrivateResource::OnBrowserOpenComplete, | 60 base::Bind(&IsolatedFileSystemPrivateResource::OnBrowserOpenComplete, |
| 53 this, type, file_system_resource, callback)); | 61 this, type, file_system_resource, callback)); |
| 54 return PP_OK_COMPLETIONPENDING; | 62 return PP_OK_COMPLETIONPENDING; |
| 55 } | 63 } |
| 56 | 64 |
| 57 void IsolatedFileSystemPrivateResource::OnBrowserOpenComplete( | 65 void IsolatedFileSystemPrivateResource::OnBrowserOpenComplete( |
| 58 PP_IsolatedFileSystemType_Private type, | 66 PP_IsolatedFileSystemType_Private type, |
| 59 PP_Resource* file_system_resource, | 67 PP_Resource* file_system_resource, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 72 connection(), pp_instance(), PP_FILESYSTEMTYPE_ISOLATED); | 80 connection(), pp_instance(), PP_FILESYSTEMTYPE_ISOLATED); |
| 73 *file_system_resource = fs->GetReference(); | 81 *file_system_resource = fs->GetReference(); |
| 74 if (*file_system_resource == 0) | 82 if (*file_system_resource == 0) |
| 75 callback->Run(PP_ERROR_FAILED); | 83 callback->Run(PP_ERROR_FAILED); |
| 76 fs->InitIsolatedFileSystem( | 84 fs->InitIsolatedFileSystem( |
| 77 fsid, type, base::Bind(&RunTrackedCallback, callback)); | 85 fsid, type, base::Bind(&RunTrackedCallback, callback)); |
| 78 } | 86 } |
| 79 | 87 |
| 80 } // namespace proxy | 88 } // namespace proxy |
| 81 } // namespace ppapi | 89 } // namespace ppapi |
| OLD | NEW |