Commit 2697f5d9 authored by chanpatorikku's avatar chanpatorikku Committed by Commit bot

[NaCl SDK] Refactor FakeFileRefInterface.

Move FakeFileRefInterface from fake_pepper_interface_html5_fs.{cc,h} to
fake_file_ref_interface.{cc,h} to share the code with the future code.

depot_tools/clang-format was run so the formatting of code is accepted
in the code review by policy. It was run in all the {.cc,.h} files.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_nacl_sdk;master.tryserver.chromium.mac:mac_nacl_sdk;master.tryserver.chromium.win:win_nacl_sdk

Review-Url: https://codereview.chromium.org/2435323002
Cr-Commit-Position: refs/heads/master@{#427283}
parent 32280ef9
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
'fake_ppapi/fake_core_interface.h', 'fake_ppapi/fake_core_interface.h',
'fake_ppapi/fake_file_io_interface.cc', 'fake_ppapi/fake_file_io_interface.cc',
'fake_ppapi/fake_file_io_interface.h', 'fake_ppapi/fake_file_io_interface.h',
'fake_ppapi/fake_file_ref_interface.cc',
'fake_ppapi/fake_file_ref_interface.h',
'fake_ppapi/fake_host_resolver_interface.cc', 'fake_ppapi/fake_host_resolver_interface.cc',
'fake_ppapi/fake_host_resolver_interface.h', 'fake_ppapi/fake_host_resolver_interface.h',
'fake_ppapi/fake_messaging_interface.cc', 'fake_ppapi/fake_messaging_interface.cc',
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "fake_ppapi/fake_file_ref_interface.h"
#include <vector>
#include <ppapi/c/pp_completion_callback.h>
#include <ppapi/c/pp_directory_entry.h>
#include <ppapi/c/pp_errors.h>
#include "gtest/gtest.h"
#include "fake_ppapi/fake_core_interface.h"
#include "fake_ppapi/fake_pepper_interface_html5_fs.h"
#include "fake_ppapi/fake_util.h"
#include "fake_ppapi/fake_var_interface.h"
FakeFileRefInterface::FakeFileRefInterface(FakeCoreInterface* core_interface,
FakeVarInterface* var_interface)
: core_interface_(core_interface), var_interface_(var_interface) {}
PP_Resource FakeFileRefInterface::Create(PP_Resource file_system,
const char* path) {
FakeFileSystemResource* file_system_resource =
core_interface_->resource_manager()->Get<FakeFileSystemResource>(
file_system);
if (file_system_resource == NULL)
return PP_ERROR_BADRESOURCE;
if (!file_system_resource->opened)
return PP_ERROR_FAILED;
if (path == NULL)
return PP_ERROR_FAILED;
size_t path_len = strlen(path);
if (path_len == 0)
return PP_ERROR_FAILED;
FakeFileRefResource* file_ref_resource = new FakeFileRefResource;
file_ref_resource->filesystem = file_system_resource->filesystem;
file_ref_resource->path = path;
// Remove a trailing slash from the path, unless it is the root path.
if (path_len > 1 && file_ref_resource->path[path_len - 1] == '/')
file_ref_resource->path.erase(path_len - 1);
return CREATE_RESOURCE(core_interface_->resource_manager(),
FakeFileRefResource, file_ref_resource);
}
PP_Var FakeFileRefInterface::GetName(PP_Resource file_ref) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_MakeUndefined();
return var_interface_->VarFromUtf8(file_ref_resource->path.c_str(),
file_ref_resource->path.size());
}
int32_t FakeFileRefInterface::MakeDirectory(PP_Resource directory_ref,
PP_Bool make_parents,
PP_CompletionCallback callback) {
FakeFileRefResource* directory_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
directory_ref);
if (directory_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
// TODO(binji): We don't currently use make_parents in nacl_io, so
// I won't bother handling it yet.
if (make_parents == PP_TRUE)
return PP_ERROR_FAILED;
FakeHtml5FsFilesystem* filesystem = directory_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = directory_ref_resource->path;
// Pepper returns PP_ERROR_NOACCESS when trying to create the root directory,
// not PP_ERROR_FILEEXISTS, as you might expect.
if (path == "/")
return RunCompletionCallback(&callback, PP_ERROR_NOACCESS);
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node != NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILEEXISTS);
FakeHtml5FsFilesystem::Path parent_path = filesystem->GetParentPath(path);
FakeHtml5FsNode* parent_node = filesystem->GetNode(parent_path);
if (parent_node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
if (!parent_node->IsDirectory())
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
bool result = filesystem->AddDirectory(directory_ref_resource->path, NULL);
EXPECT_EQ(true, result);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Delete(PP_Resource file_ref,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
filesystem->RemoveNode(path);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Query(PP_Resource file_ref,
PP_FileInfo* info,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
node->GetInfo(info);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::ReadDirectoryEntries(
PP_Resource directory_ref,
const PP_ArrayOutput& output,
PP_CompletionCallback callback) {
FakeFileRefResource* directory_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
directory_ref);
if (directory_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = directory_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = directory_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
if (!node->IsDirectory())
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
FakeHtml5FsFilesystem::DirectoryEntries fake_dir_entries;
filesystem->GetDirectoryEntries(path, &fake_dir_entries);
uint32_t element_count = fake_dir_entries.size();
uint32_t element_size = sizeof(fake_dir_entries[0]);
void* data_buffer =
(*output.GetDataBuffer)(output.user_data, element_count, element_size);
if (data_buffer == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
PP_DirectoryEntry* dir_entries = static_cast<PP_DirectoryEntry*>(data_buffer);
for (uint32_t i = 0; i < element_count; ++i) {
const FakeHtml5FsFilesystem::DirectoryEntry& fake_dir_entry =
fake_dir_entries[i];
FakeFileRefResource* file_ref_resource = new FakeFileRefResource;
file_ref_resource->filesystem = directory_ref_resource->filesystem;
file_ref_resource->path = fake_dir_entry.path;
PP_Resource file_ref =
CREATE_RESOURCE(core_interface_->resource_manager(),
FakeFileRefResource, file_ref_resource);
dir_entries[i].file_ref = file_ref;
dir_entries[i].file_type = fake_dir_entry.node->file_type();
}
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Rename(PP_Resource file_ref,
PP_Resource new_file_ref,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeFileRefResource* new_file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
new_file_ref);
if (new_file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsFilesystem::Path newpath = new_file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
// FakeFileRefResource does not support directory rename.
if (!node->IsRegular())
return RunCompletionCallback(&callback, PP_ERROR_NOTAFILE);
// Remove the destination if it exists.
filesystem->RemoveNode(newpath);
const std::vector<uint8_t> contents = node->contents();
EXPECT_TRUE(filesystem->AddFile(newpath, contents, NULL));
EXPECT_TRUE(filesystem->RemoveNode(path));
return RunCompletionCallback(&callback, PP_OK);
}
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef LIBRARIES_NACL_IO_TEST_FAKE_FILE_REF_INTERFACE_H_
#define LIBRARIES_NACL_IO_TEST_FAKE_FILE_REF_INTERFACE_H_
#include "fake_ppapi/fake_core_interface.h"
#include "fake_ppapi/fake_var_interface.h"
#include "fake_ppapi/fake_var_manager.h"
#include "sdk_util/macros.h"
class FakeFileRefInterface : public nacl_io::FileRefInterface {
public:
FakeFileRefInterface(FakeCoreInterface* core_interface,
FakeVarInterface* var_interface);
virtual PP_Resource Create(PP_Resource file_system, const char* path);
virtual PP_Var GetName(PP_Resource file_ref);
virtual int32_t MakeDirectory(PP_Resource directory_ref,
PP_Bool make_parents,
PP_CompletionCallback callback);
virtual int32_t Delete(PP_Resource file_ref, PP_CompletionCallback callback);
virtual int32_t Query(PP_Resource file_ref,
PP_FileInfo* info,
PP_CompletionCallback callback);
virtual int32_t ReadDirectoryEntries(PP_Resource file_ref,
const PP_ArrayOutput& output,
PP_CompletionCallback callback);
virtual int32_t Rename(PP_Resource file_ref,
PP_Resource new_file_ref,
PP_CompletionCallback callback);
private:
FakeCoreInterface* core_interface_; // Weak reference.
FakeVarInterface* var_interface_; // Weak reference.
FakeVarManager* var_manager_; // Weak reference
DISALLOW_COPY_AND_ASSIGN(FakeFileRefInterface);
};
#endif // LIBRARIES_NACL_IO_TEST_FAKE_FILE_REF_INTERFACE_H_
...@@ -26,16 +26,6 @@ class FakeInstanceResource : public FakeResource { ...@@ -26,16 +26,6 @@ class FakeInstanceResource : public FakeResource {
FakeHtml5FsFilesystem* filesystem_template; // Weak reference. FakeHtml5FsFilesystem* filesystem_template; // Weak reference.
}; };
class FakeFileSystemResource : public FakeResource {
public:
FakeFileSystemResource() : filesystem(NULL), opened(false) {}
~FakeFileSystemResource() { delete filesystem; }
static const char* classname() { return "FakeFileSystemResource"; }
FakeHtml5FsFilesystem* filesystem; // Owned.
bool opened;
};
} // namespace } // namespace
FakeHtml5FsNode::FakeHtml5FsNode(const PP_FileInfo& info) : info_(info) {} FakeHtml5FsNode::FakeHtml5FsNode(const PP_FileInfo& info) : info_(info) {}
...@@ -253,205 +243,6 @@ FakeHtml5FsFilesystem::Path FakeHtml5FsFilesystem::GetParentPath( ...@@ -253,205 +243,6 @@ FakeHtml5FsFilesystem::Path FakeHtml5FsFilesystem::GetParentPath(
return path.substr(0, last_slash); return path.substr(0, last_slash);
} }
FakeFileRefInterface::FakeFileRefInterface(FakeCoreInterface* core_interface,
FakeVarInterface* var_interface)
: core_interface_(core_interface), var_interface_(var_interface) {}
PP_Resource FakeFileRefInterface::Create(PP_Resource file_system,
const char* path) {
FakeFileSystemResource* file_system_resource =
core_interface_->resource_manager()->Get<FakeFileSystemResource>(
file_system);
if (file_system_resource == NULL)
return PP_ERROR_BADRESOURCE;
if (!file_system_resource->opened)
return PP_ERROR_FAILED;
if (path == NULL)
return PP_ERROR_FAILED;
size_t path_len = strlen(path);
if (path_len == 0)
return PP_ERROR_FAILED;
FakeFileRefResource* file_ref_resource = new FakeFileRefResource;
file_ref_resource->filesystem = file_system_resource->filesystem;
file_ref_resource->path = path;
// Remove a trailing slash from the path, unless it is the root path.
if (path_len > 1 && file_ref_resource->path[path_len - 1] == '/')
file_ref_resource->path.erase(path_len - 1);
return CREATE_RESOURCE(core_interface_->resource_manager(),
FakeFileRefResource, file_ref_resource);
}
PP_Var FakeFileRefInterface::GetName(PP_Resource file_ref) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_MakeUndefined();
return var_interface_->VarFromUtf8(file_ref_resource->path.c_str(),
file_ref_resource->path.size());
}
int32_t FakeFileRefInterface::MakeDirectory(PP_Resource directory_ref,
PP_Bool make_parents,
PP_CompletionCallback callback) {
FakeFileRefResource* directory_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
directory_ref);
if (directory_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
// TODO(binji): We don't currently use make_parents in nacl_io, so
// I won't bother handling it yet.
if (make_parents == PP_TRUE)
return PP_ERROR_FAILED;
FakeHtml5FsFilesystem* filesystem = directory_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = directory_ref_resource->path;
// Pepper returns PP_ERROR_NOACCESS when trying to create the root directory,
// not PP_ERROR_FILEEXISTS, as you might expect.
if (path == "/")
return RunCompletionCallback(&callback, PP_ERROR_NOACCESS);
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node != NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILEEXISTS);
FakeHtml5FsFilesystem::Path parent_path = filesystem->GetParentPath(path);
FakeHtml5FsNode* parent_node = filesystem->GetNode(parent_path);
if (parent_node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
if (!parent_node->IsDirectory())
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
bool result = filesystem->AddDirectory(directory_ref_resource->path, NULL);
EXPECT_EQ(true, result);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Delete(PP_Resource file_ref,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
filesystem->RemoveNode(path);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Query(PP_Resource file_ref,
PP_FileInfo* info,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
node->GetInfo(info);
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::ReadDirectoryEntries(
PP_Resource directory_ref,
const PP_ArrayOutput& output,
PP_CompletionCallback callback) {
FakeFileRefResource* directory_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
directory_ref);
if (directory_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = directory_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = directory_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
if (!node->IsDirectory())
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
FakeHtml5FsFilesystem::DirectoryEntries fake_dir_entries;
filesystem->GetDirectoryEntries(path, &fake_dir_entries);
uint32_t element_count = fake_dir_entries.size();
uint32_t element_size = sizeof(fake_dir_entries[0]);
void* data_buffer =
(*output.GetDataBuffer)(output.user_data, element_count, element_size);
if (data_buffer == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FAILED);
PP_DirectoryEntry* dir_entries = static_cast<PP_DirectoryEntry*>(data_buffer);
for (uint32_t i = 0; i < element_count; ++i) {
const FakeHtml5FsFilesystem::DirectoryEntry& fake_dir_entry =
fake_dir_entries[i];
FakeFileRefResource* file_ref_resource = new FakeFileRefResource;
file_ref_resource->filesystem = directory_ref_resource->filesystem;
file_ref_resource->path = fake_dir_entry.path;
PP_Resource file_ref =
CREATE_RESOURCE(core_interface_->resource_manager(),
FakeFileRefResource, file_ref_resource);
dir_entries[i].file_ref = file_ref;
dir_entries[i].file_type = fake_dir_entry.node->file_type();
}
return RunCompletionCallback(&callback, PP_OK);
}
int32_t FakeFileRefInterface::Rename(PP_Resource file_ref,
PP_Resource new_file_ref,
PP_CompletionCallback callback) {
FakeFileRefResource* file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(file_ref);
if (file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeFileRefResource* new_file_ref_resource =
core_interface_->resource_manager()->Get<FakeFileRefResource>(
new_file_ref);
if (new_file_ref_resource == NULL)
return PP_ERROR_BADRESOURCE;
FakeHtml5FsFilesystem* filesystem = file_ref_resource->filesystem;
FakeHtml5FsFilesystem::Path path = file_ref_resource->path;
FakeHtml5FsFilesystem::Path newpath = new_file_ref_resource->path;
FakeHtml5FsNode* node = filesystem->GetNode(path);
if (node == NULL)
return RunCompletionCallback(&callback, PP_ERROR_FILENOTFOUND);
// FakeFileRefResource does not support directory rename.
if (!node->IsRegular())
return RunCompletionCallback(&callback, PP_ERROR_NOTAFILE);
// Remove the destination if it exists.
filesystem->RemoveNode(newpath);
const std::vector<uint8_t> contents = node->contents();
EXPECT_TRUE(filesystem->AddFile(newpath, contents, NULL));
EXPECT_TRUE(filesystem->RemoveNode(path));
return RunCompletionCallback(&callback, PP_OK);
}
FakeFileSystemInterface::FakeFileSystemInterface( FakeFileSystemInterface::FakeFileSystemInterface(
FakeCoreInterface* core_interface) FakeCoreInterface* core_interface)
: core_interface_(core_interface) {} : core_interface_(core_interface) {}
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "fake_ppapi/fake_core_interface.h" #include "fake_ppapi/fake_core_interface.h"
#include "fake_ppapi/fake_file_io_interface.h" #include "fake_ppapi/fake_file_io_interface.h"
#include "fake_ppapi/fake_file_ref_interface.h"
#include "fake_ppapi/fake_var_interface.h" #include "fake_ppapi/fake_var_interface.h"
#include "fake_ppapi/fake_var_manager.h" #include "fake_ppapi/fake_var_manager.h"
#include "nacl_io/pepper_interface_dummy.h" #include "nacl_io/pepper_interface_dummy.h"
...@@ -98,35 +99,6 @@ class FakeHtml5FsFilesystem { ...@@ -98,35 +99,6 @@ class FakeHtml5FsFilesystem {
PP_FileSystemType filesystem_type_; PP_FileSystemType filesystem_type_;
}; };
class FakeFileRefInterface : public nacl_io::FileRefInterface {
public:
FakeFileRefInterface(FakeCoreInterface* core_interface,
FakeVarInterface* var_interface);
virtual PP_Resource Create(PP_Resource file_system, const char* path);
virtual PP_Var GetName(PP_Resource file_ref);
virtual int32_t MakeDirectory(PP_Resource directory_ref,
PP_Bool make_parents,
PP_CompletionCallback callback);
virtual int32_t Delete(PP_Resource file_ref, PP_CompletionCallback callback);
virtual int32_t Query(PP_Resource file_ref,
PP_FileInfo* info,
PP_CompletionCallback callback);
virtual int32_t ReadDirectoryEntries(PP_Resource file_ref,
const PP_ArrayOutput& output,
PP_CompletionCallback callback);
virtual int32_t Rename(PP_Resource file_ref,
PP_Resource new_file_ref,
PP_CompletionCallback callback);
private:
FakeCoreInterface* core_interface_; // Weak reference.
FakeVarInterface* var_interface_; // Weak reference.
FakeVarManager* var_manager_; // Weak reference
DISALLOW_COPY_AND_ASSIGN(FakeFileRefInterface);
};
class FakeFileSystemInterface : public nacl_io::FileSystemInterface { class FakeFileSystemInterface : public nacl_io::FileSystemInterface {
public: public:
FakeFileSystemInterface(FakeCoreInterface* core_interface); FakeFileSystemInterface(FakeCoreInterface* core_interface);
......
...@@ -22,6 +22,16 @@ class FakeFileRefResource : public FakeResource { ...@@ -22,6 +22,16 @@ class FakeFileRefResource : public FakeResource {
std::string contents; std::string contents;
}; };
class FakeFileSystemResource : public FakeResource {
public:
FakeFileSystemResource() : filesystem(NULL), opened(false) {}
~FakeFileSystemResource() { delete filesystem; }
static const char* classname() { return "FakeFileSystemResource"; }
FakeHtml5FsFilesystem* filesystem; // Owned.
bool opened;
};
int32_t RunCompletionCallback(PP_CompletionCallback* callback, int32_t result); int32_t RunCompletionCallback(PP_CompletionCallback* callback, int32_t result);
#endif // LIBRARIES_NACL_IO_TEST_FAKE_UTIL_H_ #endif // LIBRARIES_NACL_IO_TEST_FAKE_UTIL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment