| Index: trunk/src/components/nacl/renderer/ppb_nacl_private_impl.cc
|
| ===================================================================
|
| --- trunk/src/components/nacl/renderer/ppb_nacl_private_impl.cc (revision 269875)
|
| +++ trunk/src/components/nacl/renderer/ppb_nacl_private_impl.cc (working copy)
|
| @@ -1114,38 +1114,16 @@
|
| return PP_FALSE;
|
| }
|
|
|
| - base::PlatformFileInfo file_info;
|
| - if (!GetPlatformFileInfo(file, &file_info)) {
|
| + const int kBufferSize = 1 << 20;
|
| + scoped_ptr<char[]> buffer(new char[kBufferSize]);
|
| + if (base::ReadPlatformFile(file, 0, buffer.get(), kBufferSize) < 0) {
|
| load_manager->ReportLoadError(
|
| PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
|
| - std::string("GetPNaClResourceInfo, GetFileInfo failed for: ") +
|
| + std::string("PnaclResources::ReadResourceInfo reading failed for: ") +
|
| filename);
|
| return PP_FALSE;
|
| }
|
|
|
| - if (file_info.size > 1 << 20) {
|
| - load_manager->ReportLoadError(
|
| - PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
|
| - std::string("GetPNaClResourceInfo, file too large: ") + filename);
|
| - return PP_FALSE;
|
| - }
|
| -
|
| - scoped_ptr<char[]> buffer(new char[file_info.size]);
|
| - if (buffer.get() == NULL) {
|
| - load_manager->ReportLoadError(
|
| - PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
|
| - std::string("GetPNaClResourceInfo, couldn't allocate for: ") +
|
| - filename);
|
| - return PP_FALSE;
|
| - }
|
| -
|
| - if (base::ReadPlatformFile(file, 0, buffer.get(), file_info.size) < 0) {
|
| - load_manager->ReportLoadError(
|
| - PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
|
| - std::string("GetPNaClResourceInfo, reading failed for: ") + filename);
|
| - return PP_FALSE;
|
| - }
|
| -
|
| // Expect the JSON file to contain a top-level object (dictionary).
|
| Json::Reader json_reader;
|
| Json::Value json_data;
|
|
|