Skip to content

Commit

Permalink
Enable PPB_DirectoryReader_Dev under NaCl
Browse files Browse the repository at this point in the history
TEST=browser_tests --gtest_filter=\*DirectoryReader\*

Review URL: https://chromiumcodereview.appspot.com/13643004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192517 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
nhiroki@chromium.org committed Apr 5, 2013
1 parent c57a302 commit 724f841
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 22 deletions.
1 change: 1 addition & 0 deletions chrome/test/ppapi/ppapi_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ TEST_PPAPI_IN_PROCESS(X509CertificatePrivate)
TEST_PPAPI_OUT_OF_PROCESS(X509CertificatePrivate)

TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(DirectoryReader)
TEST_PPAPI_NACL(DirectoryReader);

// There is no proxy. This is used for PDF metrics reporting, and PDF only
// runs in process, so there's currently no need for a proxy.
Expand Down
1 change: 0 additions & 1 deletion ppapi/ppapi_shared.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@
'thunk/ppb_buffer_trusted_thunk.cc',
'thunk/ppb_content_decryptor_private_thunk.cc',
'thunk/ppb_char_set_thunk.cc',
'thunk/ppb_directory_reader_thunk.cc',
'thunk/ppb_file_io_trusted_thunk.cc',
'thunk/ppb_flash_clipboard_thunk.cc',
'thunk/ppb_flash_device_id_thunk.cc',
Expand Down
14 changes: 7 additions & 7 deletions ppapi/proxy/resource_creation_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ InterfaceProxy* ResourceCreationProxy::Create(Dispatcher* dispatcher) {
return new ResourceCreationProxy(dispatcher);
}

PP_Resource ResourceCreationProxy::CreateDirectoryReader(
PP_Instance instance,
PP_Resource directory_ref) {
return (new DirectoryReaderResource(
GetConnection(), instance, directory_ref))->GetReference();
}

PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) {
return (new FileIOResource(GetConnection(), instance))->GetReference();
}
Expand Down Expand Up @@ -328,13 +335,6 @@ PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance,
return PPB_Buffer_Proxy::CreateProxyResource(instance, size);
}

PP_Resource ResourceCreationProxy::CreateDirectoryReader(
PP_Instance instance,
PP_Resource directory_ref) {
return (new DirectoryReaderResource(
GetConnection(), instance, directory_ref))->GetReference();
}

PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) {
return (new FlashDeviceIDResource(GetConnection(), instance))->GetReference();
}
Expand Down
5 changes: 2 additions & 3 deletions ppapi/proxy/resource_creation_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class ResourceCreationProxy : public InterfaceProxy,
static InterfaceProxy* Create(Dispatcher* dispatcher);

// ResourceCreationAPI (called in plugin).
virtual PP_Resource CreateDirectoryReader(PP_Instance instance,
PP_Resource directory_ref) OVERRIDE;
virtual PP_Resource CreateFileIO(PP_Instance instance) OVERRIDE;
virtual PP_Resource CreateFileRef(PP_Resource file_system,
const char* path) OVERRIDE;
Expand Down Expand Up @@ -143,9 +145,6 @@ class ResourceCreationProxy : public InterfaceProxy,
const PP_BrowserFont_Trusted_Description* description) OVERRIDE;
virtual PP_Resource CreateBuffer(PP_Instance instance,
uint32_t size) OVERRIDE;
virtual PP_Resource CreateDirectoryReader(
PP_Instance instance,
PP_Resource directory_ref) OVERRIDE;
virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) OVERRIDE;
virtual PP_Resource CreateFlashFontFile(
PP_Instance instance,
Expand Down
6 changes: 0 additions & 6 deletions ppapi/tests/test_file_ref.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const char* kTempFileName = "temporary";
const char* kParentPath = "/foo/bar";
const char* kPersFilePath = "/foo/bar/persistent";
const char* kTempFilePath = "/foo/bar/temporary";
#ifndef PPAPI_OS_NACL // Only used for a test that NaCl can't run yet.
const char* kTerribleName = "!@#$%^&*()-_=+{}[] ;:'\"|`~\t\n\r\b?";
#endif

std::string ReportMismatch(const std::string& method_name,
const std::string& returned_result,
Expand Down Expand Up @@ -81,9 +79,7 @@ void TestFileRef::RunTests(const std::string& filter) {
RUN_TEST_FORCEASYNC_AND_NOT(DeleteFileAndDirectory, filter);
RUN_TEST_FORCEASYNC_AND_NOT(RenameFileAndDirectory, filter);
RUN_CALLBACK_TEST(TestFileRef, Query, filter);
#ifndef PPAPI_OS_NACL // NaCl can't run this test yet.
RUN_TEST_FORCEASYNC_AND_NOT(FileNameEscaping, filter);
#endif
}

std::string TestFileRef::TestCreate() {
Expand Down Expand Up @@ -745,7 +741,6 @@ std::string TestFileRef::TestQuery() {
PASS();
}

#ifndef PPAPI_OS_NACL
std::string TestFileRef::TestFileNameEscaping() {
TestCompletionCallback callback(instance_->pp_instance(), force_async_);
pp::FileSystem file_system(instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY);
Expand Down Expand Up @@ -803,4 +798,3 @@ std::string TestFileRef::TestFileNameEscaping() {

PASS();
}
#endif
4 changes: 2 additions & 2 deletions ppapi/thunk/interfaces_ppb_public_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
PROXIED_IFACE(PPB_Instance, "PPB_Console(Dev);0.1", PPB_Console_1_0)
PROXIED_IFACE(NoAPIName, PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4,
PPB_CursorControl_Dev_0_4)
PROXIED_IFACE(NoAPIName, PPB_DIRECTORYREADER_DEV_INTERFACE_0_6,
PPB_DirectoryReader_Dev_0_6)
PROXIED_IFACE(NoAPIName, PPB_EXT_ALARMS_DEV_INTERFACE_0_1,
PPB_Ext_Alarms_Dev_0_1)
PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_DEV_INTERFACE_0_5,
Expand Down Expand Up @@ -59,8 +61,6 @@ PROXIED_IFACE(PPB_Graphics3D,
PPB_GLESChromiumTextureMapping_Dev_0_1)
PROXIED_IFACE(NoAPIName, PPB_CRYPTO_DEV_INTERFACE_0_1, PPB_Crypto_Dev_0_1)
PROXIED_IFACE(NoAPIName, PPB_DEVICEREF_DEV_INTERFACE_0_1, PPB_DeviceRef_Dev_0_1)
PROXIED_IFACE(NoAPIName, PPB_DIRECTORYREADER_DEV_INTERFACE_0_6,
PPB_DirectoryReader_Dev_0_6)
PROXIED_IFACE(NoAPIName, PPB_GRAPHICS2D_DEV_INTERFACE_0_1,
PPB_Graphics2D_Dev_0_1)
PROXIED_IFACE(PPB_Instance, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev_0_4)
Expand Down
5 changes: 2 additions & 3 deletions ppapi/thunk/resource_creation_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class ResourceCreationAPI {
public:
virtual ~ResourceCreationAPI() {}

virtual PP_Resource CreateDirectoryReader(PP_Instance instance,
PP_Resource directory_ref) = 0;
virtual PP_Resource CreateFileIO(PP_Instance instance) = 0;
virtual PP_Resource CreateFileRef(PP_Resource file_system,
const char* path) = 0;
Expand Down Expand Up @@ -150,9 +152,6 @@ class ResourceCreationAPI {
PP_Instance instance,
const PP_BrowserFont_Trusted_Description* description) = 0;
virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0;
virtual PP_Resource CreateDirectoryReader(
PP_Instance instance,
PP_Resource directory_ref) = 0;
virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0;
virtual PP_Resource CreateFlashFontFile(
PP_Instance instance,
Expand Down

0 comments on commit 724f841

Please sign in to comment.