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

Side by Side Diff: trunk/src/components/nacl/loader/nonsfi/irt_interfaces.cc

Issue 265433002: Revert 266968 "NonSFI NaCl: Plumb Exception IRT enough for break..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « trunk/src/components/nacl/loader/nonsfi/irt_interfaces.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/loader/nonsfi/irt_interfaces.h" 5 #include "components/nacl/loader/nonsfi/irt_interfaces.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 namespace nacl { 9 namespace nacl {
10 namespace nonsfi { 10 namespace nonsfi {
(...skipping 13 matching lines...) Expand all
24 const NaClInterfaceTable kIrtInterfaces[] = { 24 const NaClInterfaceTable kIrtInterfaces[] = {
25 NACL_INTERFACE_TABLE(NACL_IRT_BASIC_v0_1, kIrtBasic), 25 NACL_INTERFACE_TABLE(NACL_IRT_BASIC_v0_1, kIrtBasic),
26 NACL_INTERFACE_TABLE(NACL_IRT_DEV_FDIO_v0_1, kIrtFdIO), 26 NACL_INTERFACE_TABLE(NACL_IRT_DEV_FDIO_v0_1, kIrtFdIO),
27 NACL_INTERFACE_TABLE(NACL_IRT_MEMORY_v0_3, kIrtMemory), 27 NACL_INTERFACE_TABLE(NACL_IRT_MEMORY_v0_3, kIrtMemory),
28 NACL_INTERFACE_TABLE(NACL_IRT_THREAD_v0_1, kIrtThread), 28 NACL_INTERFACE_TABLE(NACL_IRT_THREAD_v0_1, kIrtThread),
29 NACL_INTERFACE_TABLE(NACL_IRT_FUTEX_v0_1, kIrtFutex), 29 NACL_INTERFACE_TABLE(NACL_IRT_FUTEX_v0_1, kIrtFutex),
30 NACL_INTERFACE_TABLE(NACL_IRT_TLS_v0_1, kIrtTls), 30 NACL_INTERFACE_TABLE(NACL_IRT_TLS_v0_1, kIrtTls),
31 NACL_INTERFACE_TABLE(NACL_IRT_CLOCK_v0_1, kIrtClock), 31 NACL_INTERFACE_TABLE(NACL_IRT_CLOCK_v0_1, kIrtClock),
32 NACL_INTERFACE_TABLE(NACL_IRT_PPAPIHOOK_v0_1, kIrtPpapiHook), 32 NACL_INTERFACE_TABLE(NACL_IRT_PPAPIHOOK_v0_1, kIrtPpapiHook),
33 NACL_INTERFACE_TABLE(NACL_IRT_RANDOM_v0_1, kIrtRandom), 33 NACL_INTERFACE_TABLE(NACL_IRT_RANDOM_v0_1, kIrtRandom),
34 NACL_INTERFACE_TABLE(NACL_IRT_EXCEPTION_HANDLING_v0_1, kIrtExceptionHandling),
35 }; 34 };
36 #undef NACL_INTERFACE_TABLE 35 #undef NACL_INTERFACE_TABLE
37 36
38 } // namespace 37 } // namespace
39 38
40 size_t NaClIrtInterface(const char* interface_ident, 39 size_t NaClIrtInterface(const char* interface_ident,
41 void* table, size_t tablesize) { 40 void* table, size_t tablesize) {
42 for (size_t i = 0; i < arraysize(kIrtInterfaces); ++i) { 41 for (size_t i = 0; i < arraysize(kIrtInterfaces); ++i) {
43 if (std::strcmp(interface_ident, kIrtInterfaces[i].name) == 0) { 42 if (std::strcmp(interface_ident, kIrtInterfaces[i].name) == 0) {
44 const size_t size = kIrtInterfaces[i].size; 43 const size_t size = kIrtInterfaces[i].size;
45 if (size <= tablesize) { 44 if (size <= tablesize) {
46 std::memcpy(table, kIrtInterfaces[i].table, size); 45 std::memcpy(table, kIrtInterfaces[i].table, size);
47 return size; 46 return size;
48 } 47 }
49 break; 48 break;
50 } 49 }
51 } 50 }
52 return 0; 51 return 0;
53 } 52 }
54 53
55 } // namespace nonsfi 54 } // namespace nonsfi
56 } // namespace nacl 55 } // namespace nacl
OLDNEW
« no previous file with comments | « trunk/src/components/nacl/loader/nonsfi/irt_interfaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698