OLD | NEW |
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 #ifndef DISABLE_NACL | 7 #ifndef DISABLE_NACL |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 if (transit_fd == IPC::InvalidPlatformFileForTransit()) { | 250 if (transit_fd == IPC::InvalidPlatformFileForTransit()) { |
251 return base::kInvalidPlatformFileValue; | 251 return base::kInvalidPlatformFileValue; |
252 } | 252 } |
253 | 253 |
254 base::PlatformFile handle = IPC::PlatformFileForTransitToPlatformFile( | 254 base::PlatformFile handle = IPC::PlatformFileForTransitToPlatformFile( |
255 transit_fd); | 255 transit_fd); |
256 return handle; | 256 return handle; |
257 } | 257 } |
258 | 258 |
| 259 int32_t GetNumberOfProcessors() { |
| 260 int32_t num_processors; |
| 261 IPC::Sender* sender = content::RenderThread::Get(); |
| 262 DCHECK(sender); |
| 263 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { |
| 264 return 1; |
| 265 } |
| 266 return num_processors; |
| 267 } |
| 268 |
259 int32_t GetNexeFd(PP_Instance instance, | 269 int32_t GetNexeFd(PP_Instance instance, |
260 const char* pexe_url, | 270 const char* pexe_url, |
261 uint32_t abi_version, | 271 uint32_t abi_version, |
262 uint32_t opt_level, | 272 uint32_t opt_level, |
263 const char* last_modified, | 273 const char* last_modified, |
264 const char* etag, | 274 const char* etag, |
265 PP_Bool has_no_store_header, | 275 PP_Bool has_no_store_header, |
266 PP_Bool* is_hit, | 276 PP_Bool* is_hit, |
267 PP_FileHandle* handle, | 277 PP_FileHandle* handle, |
268 struct PP_CompletionCallback callback) { | 278 struct PP_CompletionCallback callback) { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 468 } |
459 | 469 |
460 const PPB_NaCl_Private nacl_interface = { | 470 const PPB_NaCl_Private nacl_interface = { |
461 &LaunchSelLdr, | 471 &LaunchSelLdr, |
462 &StartPpapiProxy, | 472 &StartPpapiProxy, |
463 &UrandomFD, | 473 &UrandomFD, |
464 &Are3DInterfacesDisabled, | 474 &Are3DInterfacesDisabled, |
465 &BrokerDuplicateHandle, | 475 &BrokerDuplicateHandle, |
466 &GetReadonlyPnaclFD, | 476 &GetReadonlyPnaclFD, |
467 &CreateTemporaryFile, | 477 &CreateTemporaryFile, |
| 478 &GetNumberOfProcessors, |
468 &GetNexeFd, | 479 &GetNexeFd, |
469 &ReportTranslationFinished, | 480 &ReportTranslationFinished, |
470 &ReportNaClError, | 481 &ReportNaClError, |
471 &OpenNaClExecutable, | 482 &OpenNaClExecutable, |
472 &DispatchEvent, | 483 &DispatchEvent, |
473 &SetReadOnlyProperty | 484 &SetReadOnlyProperty |
474 }; | 485 }; |
475 | 486 |
476 } // namespace | 487 } // namespace |
477 | 488 |
478 namespace nacl { | 489 namespace nacl { |
479 | 490 |
480 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 491 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
481 return &nacl_interface; | 492 return &nacl_interface; |
482 } | 493 } |
483 | 494 |
484 } // namespace nacl | 495 } // namespace nacl |
485 | 496 |
486 #endif // DISABLE_NACL | 497 #endif // DISABLE_NACL |
OLD | NEW |