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

Side by Side Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 307173002: Remove PlatformFile from components/nacl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "components/nacl/renderer/ppb_nacl_private_impl.h" 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
6 6
7 #include <numeric> 7 #include <numeric>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 PP_FileHandle GetReadonlyPnaclFd(const char* url) { 548 PP_FileHandle GetReadonlyPnaclFd(const char* url) {
549 std::string filename = PnaclComponentURLToFilename(url); 549 std::string filename = PnaclComponentURLToFilename(url);
550 IPC::PlatformFileForTransit out_fd = IPC::InvalidPlatformFileForTransit(); 550 IPC::PlatformFileForTransit out_fd = IPC::InvalidPlatformFileForTransit();
551 IPC::Sender* sender = content::RenderThread::Get(); 551 IPC::Sender* sender = content::RenderThread::Get();
552 DCHECK(sender); 552 DCHECK(sender);
553 if (!sender->Send(new NaClHostMsg_GetReadonlyPnaclFD( 553 if (!sender->Send(new NaClHostMsg_GetReadonlyPnaclFD(
554 std::string(filename), 554 std::string(filename),
555 &out_fd))) { 555 &out_fd))) {
556 return base::kInvalidPlatformFileValue; 556 return PP_kInvalidFileHandle;
557 } 557 }
558 if (out_fd == IPC::InvalidPlatformFileForTransit()) { 558 if (out_fd == IPC::InvalidPlatformFileForTransit()) {
559 return base::kInvalidPlatformFileValue; 559 return PP_kInvalidFileHandle;
560 } 560 }
561 base::PlatformFile handle = 561 return IPC::PlatformFileForTransitToPlatformFile(out_fd);
562 IPC::PlatformFileForTransitToPlatformFile(out_fd);
563 return handle;
564 } 562 }
565 563
566 PP_FileHandle CreateTemporaryFile(PP_Instance instance) { 564 PP_FileHandle CreateTemporaryFile(PP_Instance instance) {
567 IPC::PlatformFileForTransit transit_fd = IPC::InvalidPlatformFileForTransit(); 565 IPC::PlatformFileForTransit transit_fd = IPC::InvalidPlatformFileForTransit();
568 IPC::Sender* sender = content::RenderThread::Get(); 566 IPC::Sender* sender = content::RenderThread::Get();
569 DCHECK(sender); 567 DCHECK(sender);
570 if (!sender->Send(new NaClHostMsg_NaClCreateTemporaryFile( 568 if (!sender->Send(new NaClHostMsg_NaClCreateTemporaryFile(
571 &transit_fd))) { 569 &transit_fd))) {
572 return base::kInvalidPlatformFileValue; 570 return PP_kInvalidFileHandle;
573 } 571 }
574 572
575 if (transit_fd == IPC::InvalidPlatformFileForTransit()) { 573 if (transit_fd == IPC::InvalidPlatformFileForTransit()) {
576 return base::kInvalidPlatformFileValue; 574 return PP_kInvalidFileHandle;
577 } 575 }
578 576
579 base::PlatformFile handle = IPC::PlatformFileForTransitToPlatformFile( 577 return IPC::PlatformFileForTransitToPlatformFile(transit_fd);
580 transit_fd);
581 return handle;
582 } 578 }
583 579
584 int32_t GetNumberOfProcessors() { 580 int32_t GetNumberOfProcessors() {
585 int32_t num_processors; 581 int32_t num_processors;
586 IPC::Sender* sender = content::RenderThread::Get(); 582 IPC::Sender* sender = content::RenderThread::Get();
587 DCHECK(sender); 583 DCHECK(sender);
588 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { 584 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) {
589 return 1; 585 return 1;
590 } 586 }
591 return num_processors; 587 return num_processors;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 DCHECK(sender); 689 DCHECK(sender);
694 *nonce_lo = 0; 690 *nonce_lo = 0;
695 *nonce_hi = 0; 691 *nonce_hi = 0;
696 base::FilePath file_path; 692 base::FilePath file_path;
697 if (!sender->Send( 693 if (!sender->Send(
698 new NaClHostMsg_OpenNaClExecutable(GetRoutingID(instance), 694 new NaClHostMsg_OpenNaClExecutable(GetRoutingID(instance),
699 GURL(file_url), 695 GURL(file_url),
700 &out_fd, 696 &out_fd,
701 nonce_lo, 697 nonce_lo,
702 nonce_hi))) { 698 nonce_hi))) {
703 return base::kInvalidPlatformFileValue; 699 return PP_kInvalidFileHandle;
704 } 700 }
705 701
706 if (out_fd == IPC::InvalidPlatformFileForTransit()) { 702 if (out_fd == IPC::InvalidPlatformFileForTransit())
707 return base::kInvalidPlatformFileValue; 703 return PP_kInvalidFileHandle;
708 }
709 704
710 base::PlatformFile handle = 705 return IPC::PlatformFileForTransitToPlatformFile(out_fd);
711 IPC::PlatformFileForTransitToPlatformFile(out_fd);
712 return handle;
713 } 706 }
714 707
715 void DispatchEvent(PP_Instance instance, 708 void DispatchEvent(PP_Instance instance,
716 PP_NaClEventType event_type, 709 PP_NaClEventType event_type,
717 const char *resource_url, 710 const char *resource_url,
718 PP_Bool length_is_computable, 711 PP_Bool length_is_computable,
719 uint64_t loaded_bytes, 712 uint64_t loaded_bytes,
720 uint64_t total_bytes) { 713 uint64_t total_bytes) {
721 ProgressEvent event(event_type, 714 ProgressEvent event(event_type,
722 resource_url, 715 resource_url,
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 1113
1121 PP_Bool GetPNaClResourceInfo(PP_Instance instance, 1114 PP_Bool GetPNaClResourceInfo(PP_Instance instance,
1122 const char* filename, 1115 const char* filename,
1123 PP_Var* llc_tool_name, 1116 PP_Var* llc_tool_name,
1124 PP_Var* ld_tool_name) { 1117 PP_Var* ld_tool_name) {
1125 NexeLoadManager* load_manager = GetNexeLoadManager(instance); 1118 NexeLoadManager* load_manager = GetNexeLoadManager(instance);
1126 DCHECK(load_manager); 1119 DCHECK(load_manager);
1127 if (!load_manager) 1120 if (!load_manager)
1128 return PP_FALSE; 1121 return PP_FALSE;
1129 1122
1130 base::PlatformFile file = GetReadonlyPnaclFd(filename); 1123 // This file was not being closed!
rvargas (doing something else) 2014/06/03 17:57:23 Is this OK?
Mark Seaborn 2014/06/03 18:23:21 I don't understand the comment. Is it referring t
rvargas (doing something else) 2014/06/03 19:59:49 In any case, the comment will be removed... it was
teravest 2014/06/03 20:04:53 It should be OK to close the file there.
1131 if (file == base::kInvalidPlatformFileValue) { 1124 base::File file(GetReadonlyPnaclFd(filename));
1125 if (!file.IsValid()) {
1132 load_manager->ReportLoadError( 1126 load_manager->ReportLoadError(
1133 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, 1127 PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
1134 "The Portable Native Client (pnacl) component is not " 1128 "The Portable Native Client (pnacl) component is not "
1135 "installed. Please consult chrome://components for more " 1129 "installed. Please consult chrome://components for more "
1136 "information."); 1130 "information.");
1137 return PP_FALSE; 1131 return PP_FALSE;
1138 } 1132 }
1139 1133
1140 base::PlatformFileInfo file_info; 1134 base::File::Info file_info;
1141 if (!GetPlatformFileInfo(file, &file_info)) { 1135 if (!file.GetInfo(&file_info)) {
1142 load_manager->ReportLoadError( 1136 load_manager->ReportLoadError(
1143 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, 1137 PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
1144 std::string("GetPNaClResourceInfo, GetFileInfo failed for: ") + 1138 std::string("GetPNaClResourceInfo, GetFileInfo failed for: ") +
1145 filename); 1139 filename);
1146 return PP_FALSE; 1140 return PP_FALSE;
1147 } 1141 }
1148 1142
1149 if (file_info.size > 1 << 20) { 1143 if (file_info.size > 1 << 20) {
1150 load_manager->ReportLoadError( 1144 load_manager->ReportLoadError(
1151 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, 1145 PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
1152 std::string("GetPNaClResourceInfo, file too large: ") + filename); 1146 std::string("GetPNaClResourceInfo, file too large: ") + filename);
1153 return PP_FALSE; 1147 return PP_FALSE;
1154 } 1148 }
1155 1149
1156 scoped_ptr<char[]> buffer(new char[file_info.size + 1]); 1150 scoped_ptr<char[]> buffer(new char[file_info.size + 1]);
1157 if (buffer.get() == NULL) { 1151 if (buffer.get() == NULL) {
1158 load_manager->ReportLoadError( 1152 load_manager->ReportLoadError(
1159 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, 1153 PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
1160 std::string("GetPNaClResourceInfo, couldn't allocate for: ") + 1154 std::string("GetPNaClResourceInfo, couldn't allocate for: ") +
1161 filename); 1155 filename);
1162 return PP_FALSE; 1156 return PP_FALSE;
1163 } 1157 }
1164 1158
1165 int rc = base::ReadPlatformFile(file, 0, buffer.get(), file_info.size); 1159 int rc = file.Read(0, buffer.get(), file_info.size);
1166 if (rc < 0) { 1160 if (rc < 0) {
1167 load_manager->ReportLoadError( 1161 load_manager->ReportLoadError(
1168 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, 1162 PP_NACL_ERROR_PNACL_RESOURCE_FETCH,
1169 std::string("GetPNaClResourceInfo, reading failed for: ") + filename); 1163 std::string("GetPNaClResourceInfo, reading failed for: ") + filename);
1170 return PP_FALSE; 1164 return PP_FALSE;
1171 } 1165 }
1172 1166
1173 // Null-terminate the bytes we we read from the file. 1167 // Null-terminate the bytes we we read from the file.
1174 buffer.get()[rc] = 0; 1168 buffer.get()[rc] = 0;
1175 1169
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 last_event_ = now; 1302 last_event_ = now;
1309 } 1303 }
1310 } 1304 }
1311 1305
1312 private: 1306 private:
1313 PP_Instance instance_; 1307 PP_Instance instance_;
1314 base::Time last_event_; 1308 base::Time last_event_;
1315 }; 1309 };
1316 1310
1317 void DownloadNexeCompletion(const DownloadNexeRequest& request, 1311 void DownloadNexeCompletion(const DownloadNexeRequest& request,
1318 base::PlatformFile target_file,
1319 PP_NaClFileInfo* out_file_info, 1312 PP_NaClFileInfo* out_file_info,
1320 FileDownloader::Status status, 1313 FileDownloader::Status status,
1314 base::File target_file,
1321 int http_status); 1315 int http_status);
1322 1316
1323 void DownloadNexe(PP_Instance instance, 1317 void DownloadNexe(PP_Instance instance,
1324 const char* url, 1318 const char* url,
1325 PP_NaClFileInfo* out_file_info, 1319 PP_NaClFileInfo* out_file_info,
1326 PP_CompletionCallback callback) { 1320 PP_CompletionCallback callback) {
1327 CHECK(url); 1321 CHECK(url);
1328 CHECK(out_file_info); 1322 CHECK(out_file_info);
1329 DownloadNexeRequest request; 1323 DownloadNexeRequest request;
1330 request.instance = instance; 1324 request.instance = instance;
1331 request.url = url; 1325 request.url = url;
1332 request.callback = callback; 1326 request.callback = callback;
1333 request.start_time = base::Time::Now(); 1327 request.start_time = base::Time::Now();
1334 1328
1335 // Try the fast path for retrieving the file first. 1329 // Try the fast path for retrieving the file first.
1336 PP_FileHandle handle = OpenNaClExecutable(instance, 1330 PP_FileHandle handle = OpenNaClExecutable(instance,
1337 url, 1331 url,
1338 &out_file_info->token_lo, 1332 &out_file_info->token_lo,
1339 &out_file_info->token_hi); 1333 &out_file_info->token_hi);
1340 if (handle != PP_kInvalidFileHandle) { 1334 if (handle != PP_kInvalidFileHandle) {
1341 DownloadNexeCompletion(request, 1335 DownloadNexeCompletion(request,
1342 handle,
1343 out_file_info, 1336 out_file_info,
1344 FileDownloader::SUCCESS, 1337 FileDownloader::SUCCESS,
1338 base::File(handle),
1345 200); 1339 200);
1346 return; 1340 return;
1347 } 1341 }
1348 1342
1349 // The fast path didn't work, we'll fetch the file using URLLoader and write 1343 // The fast path didn't work, we'll fetch the file using URLLoader and write
1350 // it to local storage. 1344 // it to local storage.
1351 base::PlatformFile target_file = CreateTemporaryFile(instance); 1345 base::File target_file(CreateTemporaryFile(instance));
1352 GURL gurl(url); 1346 GURL gurl(url);
1353 1347
1354 content::PepperPluginInstance* plugin_instance = 1348 content::PepperPluginInstance* plugin_instance =
1355 content::PepperPluginInstance::Get(instance); 1349 content::PepperPluginInstance::Get(instance);
1356 if (!plugin_instance) { 1350 if (!plugin_instance) {
1357 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 1351 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
1358 FROM_HERE, 1352 FROM_HERE,
1359 base::Bind(callback.func, callback.user_data, 1353 base::Bind(callback.func, callback.user_data,
1360 static_cast<int32_t>(PP_ERROR_FAILED))); 1354 static_cast<int32_t>(PP_ERROR_FAILED)));
1361 } 1355 }
1362 const blink::WebDocument& document = 1356 const blink::WebDocument& document =
1363 plugin_instance->GetContainer()->element().document(); 1357 plugin_instance->GetContainer()->element().document();
1364 scoped_ptr<blink::WebURLLoader> url_loader( 1358 scoped_ptr<blink::WebURLLoader> url_loader(
1365 CreateWebURLLoader(document, gurl)); 1359 CreateWebURLLoader(document, gurl));
1366 blink::WebURLRequest url_request = CreateWebURLRequest(document, gurl); 1360 blink::WebURLRequest url_request = CreateWebURLRequest(document, gurl);
1367 1361
1368 ProgressEventRateLimiter* tracker = new ProgressEventRateLimiter(instance); 1362 ProgressEventRateLimiter* tracker = new ProgressEventRateLimiter(instance);
1369 1363
1370 // FileDownloader deletes itself after invoking DownloadNexeCompletion. 1364 // FileDownloader deletes itself after invoking DownloadNexeCompletion.
1371 FileDownloader* file_downloader = new FileDownloader( 1365 FileDownloader* file_downloader = new FileDownloader(
1372 url_loader.Pass(), 1366 url_loader.Pass(),
1373 target_file, 1367 target_file.Pass(),
1374 base::Bind(&DownloadNexeCompletion, request, target_file, out_file_info), 1368 base::Bind(&DownloadNexeCompletion, request, out_file_info),
1375 base::Bind(&ProgressEventRateLimiter::ReportProgress, 1369 base::Bind(&ProgressEventRateLimiter::ReportProgress,
1376 base::Owned(tracker), url)); 1370 base::Owned(tracker), url));
1377 file_downloader->Load(url_request); 1371 file_downloader->Load(url_request);
1378 } 1372 }
1379 1373
1380 void DownloadNexeCompletion(const DownloadNexeRequest& request, 1374 void DownloadNexeCompletion(const DownloadNexeRequest& request,
1381 base::PlatformFile target_file,
1382 PP_NaClFileInfo* out_file_info, 1375 PP_NaClFileInfo* out_file_info,
1383 FileDownloader::Status status, 1376 FileDownloader::Status status,
1377 base::File target_file,
1384 int http_status) { 1378 int http_status) {
1385 int32_t pp_error = FileDownloaderToPepperError(status); 1379 int32_t pp_error = FileDownloaderToPepperError(status);
1386 if (pp_error == PP_OK)
1387 out_file_info->handle = target_file;
1388
1389 int64_t bytes_read = -1; 1380 int64_t bytes_read = -1;
1390 if (pp_error == PP_OK && target_file != base::kInvalidPlatformFileValue) { 1381 if (pp_error == PP_OK && target_file.IsValid()) {
1391 base::PlatformFileInfo info; 1382 base::File::Info info;
1392 if (GetPlatformFileInfo(target_file, &info)) 1383 if (target_file.GetInfo(&info))
1393 bytes_read = info.size; 1384 bytes_read = info.size;
1394 } 1385 }
1395 1386
1396 if (bytes_read == -1) { 1387 if (bytes_read == -1) {
1397 base::ClosePlatformFile(target_file); 1388 target_file.Close();
1398 pp_error = PP_ERROR_FAILED; 1389 pp_error = PP_ERROR_FAILED;
1399 } 1390 }
1400 1391
1401 base::TimeDelta download_time = base::Time::Now() - request.start_time; 1392 base::TimeDelta download_time = base::Time::Now() - request.start_time;
1402 1393
1403 NexeLoadManager* load_manager = GetNexeLoadManager(request.instance); 1394 NexeLoadManager* load_manager = GetNexeLoadManager(request.instance);
1404 if (load_manager) { 1395 if (load_manager) {
1405 load_manager->NexeFileDidOpen(pp_error, 1396 load_manager->NexeFileDidOpen(pp_error,
1406 target_file, 1397 target_file,
1407 http_status, 1398 http_status,
1408 bytes_read, 1399 bytes_read,
1409 request.url, 1400 request.url,
1410 download_time); 1401 download_time);
1411 } 1402 }
1412 1403
1404 if (pp_error == PP_OK && target_file.IsValid())
1405 out_file_info->handle = target_file.TakePlatformFile();
1406 else
1407 out_file_info->handle = PP_kInvalidFileHandle;
1408
1413 request.callback.func(request.callback.user_data, pp_error); 1409 request.callback.func(request.callback.user_data, pp_error);
1414 } 1410 }
1415 1411
1416 void DownloadFileCompletion(base::PlatformFile file, 1412 void DownloadFileCompletion(PP_NaClFileInfo* file_info,
1417 PP_NaClFileInfo* file_info,
1418 PP_CompletionCallback callback, 1413 PP_CompletionCallback callback,
1419 FileDownloader::Status status, 1414 FileDownloader::Status status,
1415 base::File file,
1420 int http_status) { 1416 int http_status) {
1421 int32_t pp_error = FileDownloaderToPepperError(status); 1417 int32_t pp_error = FileDownloaderToPepperError(status);
1422 if (pp_error == PP_OK) { 1418 if (pp_error == PP_OK) {
1423 file_info->handle = file; 1419 file_info->handle = file.TakePlatformFile();
1424 file_info->token_lo = 0; 1420 file_info->token_lo = 0;
1425 file_info->token_hi = 0; 1421 file_info->token_hi = 0;
1426 } 1422 }
1427 callback.func(callback.user_data, pp_error); 1423 callback.func(callback.user_data, pp_error);
1428 } 1424 }
1429 1425
1430 void DownloadFile(PP_Instance instance, 1426 void DownloadFile(PP_Instance instance,
1431 const char* url, 1427 const char* url,
1432 struct PP_NaClFileInfo* file_info, 1428 struct PP_NaClFileInfo* file_info,
1433 struct PP_CompletionCallback callback) { 1429 struct PP_CompletionCallback callback) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 file_info->token_hi = file_token_hi; 1488 file_info->token_hi = file_token_hi;
1493 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 1489 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
1494 FROM_HERE, 1490 FROM_HERE,
1495 base::Bind(callback.func, callback.user_data, 1491 base::Bind(callback.func, callback.user_data,
1496 static_cast<int32_t>(PP_OK))); 1492 static_cast<int32_t>(PP_OK)));
1497 return; 1493 return;
1498 } 1494 }
1499 1495
1500 // The fast path didn't work, we'll fetch the file using URLLoader and write 1496 // The fast path didn't work, we'll fetch the file using URLLoader and write
1501 // it to local storage. 1497 // it to local storage.
1502 base::PlatformFile target_file = CreateTemporaryFile(instance); 1498 base::File target_file(CreateTemporaryFile(instance));
1503 GURL gurl(url); 1499 GURL gurl(url);
1504 1500
1505 content::PepperPluginInstance* plugin_instance = 1501 content::PepperPluginInstance* plugin_instance =
1506 content::PepperPluginInstance::Get(instance); 1502 content::PepperPluginInstance::Get(instance);
1507 if (!plugin_instance) { 1503 if (!plugin_instance) {
1508 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 1504 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
1509 FROM_HERE, 1505 FROM_HERE,
1510 base::Bind(callback.func, callback.user_data, 1506 base::Bind(callback.func, callback.user_data,
1511 static_cast<int32_t>(PP_ERROR_FAILED))); 1507 static_cast<int32_t>(PP_ERROR_FAILED)));
1512 } 1508 }
1513 const blink::WebDocument& document = 1509 const blink::WebDocument& document =
1514 plugin_instance->GetContainer()->element().document(); 1510 plugin_instance->GetContainer()->element().document();
1515 scoped_ptr<blink::WebURLLoader> url_loader( 1511 scoped_ptr<blink::WebURLLoader> url_loader(
1516 CreateWebURLLoader(document, gurl)); 1512 CreateWebURLLoader(document, gurl));
1517 blink::WebURLRequest url_request = CreateWebURLRequest(document, gurl); 1513 blink::WebURLRequest url_request = CreateWebURLRequest(document, gurl);
1518 1514
1519 ProgressEventRateLimiter* tracker = new ProgressEventRateLimiter(instance); 1515 ProgressEventRateLimiter* tracker = new ProgressEventRateLimiter(instance);
1520 1516
1521 // FileDownloader deletes itself after invoking DownloadNexeCompletion. 1517 // FileDownloader deletes itself after invoking DownloadNexeCompletion.
1522 FileDownloader* file_downloader = new FileDownloader( 1518 FileDownloader* file_downloader = new FileDownloader(
1523 url_loader.Pass(), 1519 url_loader.Pass(),
1524 target_file, 1520 target_file.Pass(),
1525 base::Bind(&DownloadFileCompletion, target_file, file_info, callback), 1521 base::Bind(&DownloadFileCompletion, file_info, callback),
1526 base::Bind(&ProgressEventRateLimiter::ReportProgress, 1522 base::Bind(&ProgressEventRateLimiter::ReportProgress,
1527 base::Owned(tracker), url)); 1523 base::Owned(tracker), url));
1528 file_downloader->Load(url_request); 1524 file_downloader->Load(url_request);
1529 } 1525 }
1530 1526
1531 const PPB_NaCl_Private nacl_interface = { 1527 const PPB_NaCl_Private nacl_interface = {
1532 &LaunchSelLdr, 1528 &LaunchSelLdr,
1533 &StartPpapiProxy, 1529 &StartPpapiProxy,
1534 &UrandomFD, 1530 &UrandomFD,
1535 &Are3DInterfacesDisabled, 1531 &Are3DInterfacesDisabled,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 &DownloadFile 1567 &DownloadFile
1572 }; 1568 };
1573 1569
1574 } // namespace 1570 } // namespace
1575 1571
1576 const PPB_NaCl_Private* GetNaClPrivateInterface() { 1572 const PPB_NaCl_Private* GetNaClPrivateInterface() {
1577 return &nacl_interface; 1573 return &nacl_interface;
1578 } 1574 }
1579 1575
1580 } // namespace nacl 1576 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698