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

Unified Diff: native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc

Issue 2455973003: [NaCl SDK] Refactor FakeFileSystemInterface. (Closed)
Patch Set: Created 4 years, 2 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: native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc
diff --git a/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc
index 6efb5b93288fff2fbee8572be5906f4381ee7534..24ecefe34e08d21033a17f82c6fc467bc88d9471 100644
--- a/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc
+++ b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_pepper_interface_html5_fs.cc
@@ -8,13 +8,10 @@
#include <algorithm>
-#include <ppapi/c/pp_completion_callback.h>
#include <ppapi/c/pp_errors.h>
#include "gtest/gtest.h"
-#include "fake_ppapi/fake_util.h"
-
namespace {
class FakeInstanceResource : public FakeResource {
@@ -242,46 +239,6 @@ FakeHtml5FsFilesystem::Path FakeHtml5FsFilesystem::GetParentPath(
return path.substr(0, last_slash);
}
-FakeFileSystemInterface::FakeFileSystemInterface(
- FakeCoreInterface* core_interface)
- : core_interface_(core_interface) {}
-
-PP_Bool FakeFileSystemInterface::IsFileSystem(PP_Resource resource) {
- bool not_found_ok = true;
- FakeFileSystemResource* file_system_resource =
- core_interface_->resource_manager()->Get<FakeFileSystemResource>(
- resource, not_found_ok);
- return file_system_resource != NULL ? PP_TRUE : PP_FALSE;
-}
-
-PP_Resource FakeFileSystemInterface::Create(PP_Instance instance,
- PP_FileSystemType filesystem_type) {
- FakeInstanceResource* instance_resource =
- core_interface_->resource_manager()->Get<FakeInstanceResource>(instance);
- if (instance_resource == NULL)
- return PP_ERROR_BADRESOURCE;
-
- FakeFileSystemResource* file_system_resource = new FakeFileSystemResource;
- file_system_resource->filesystem = new FakeHtml5FsFilesystem(
- *instance_resource->filesystem_template, filesystem_type);
-
- return CREATE_RESOURCE(core_interface_->resource_manager(),
- FakeFileSystemResource, file_system_resource);
-}
-
-int32_t FakeFileSystemInterface::Open(PP_Resource file_system,
- int64_t expected_size,
- PP_CompletionCallback callback) {
- FakeFileSystemResource* file_system_resource =
- core_interface_->resource_manager()->Get<FakeFileSystemResource>(
- file_system);
- if (file_system_resource == NULL)
- return PP_ERROR_BADRESOURCE;
-
- file_system_resource->opened = true;
- return RunCompletionCallback(&callback, PP_OK);
-}
-
FakePepperInterfaceHtml5Fs::FakePepperInterfaceHtml5Fs()
: core_interface_(&resource_manager_),
var_interface_(&var_manager_),

Powered by Google App Engine
This is Rietveld 408576698