| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 561 |
| 562 virtual bool isViewPeer() | 562 virtual bool isViewPeer() |
| 563 { | 563 { |
| 564 return true; | 564 return true; |
| 565 } | 565 } |
| 566 | 566 |
| 567 private: | 567 private: |
| 568 RefPtr<ArrayBufferView> m_view; | 568 RefPtr<ArrayBufferView> m_view; |
| 569 }; | 569 }; |
| 570 | 570 |
| 571 static void externalArrayBufferCallback(Dart_WeakPersistentHandle handle, void*
peer) | 571 static void externalArrayBufferCallback(Dart_Isolate isolate, Dart_WeakPersisten
tHandle handle, void* peer) |
| 572 { | 572 { |
| 573 Dart_DeleteWeakPersistentHandle(handle); | 573 Dart_DeleteWeakPersistentHandle(isolate, handle); |
| 574 delete reinterpret_cast<TypedDataPeer*>(peer); | 574 delete reinterpret_cast<TypedDataPeer*>(peer); |
| 575 } | 575 } |
| 576 | 576 |
| 577 static Dart_Handle createExternalTypedData(Dart_TypedData_Type type, void* data,
intptr_t numberOfElements, TypedDataPeer* peer, Dart_WeakPersistentHandleFinali
zer callback) | 577 static Dart_Handle createExternalTypedData(Dart_TypedData_Type type, void* data,
intptr_t numberOfElements, TypedDataPeer* peer, Dart_WeakPersistentHandleFinali
zer callback) |
| 578 { | 578 { |
| 579 Dart_Handle newInstance = Dart_NewExternalTypedData(type, data, numberOfElem
ents); | 579 Dart_Handle newInstance = Dart_NewExternalTypedData(type, data, numberOfElem
ents); |
| 580 Dart_Handle result = Dart_SetPeer(newInstance, peer); | 580 Dart_Handle result = Dart_SetPeer(newInstance, peer); |
| 581 if (Dart_IsError(result)) | 581 if (Dart_IsError(result)) |
| 582 return result; | 582 return result; |
| 583 Dart_NewWeakPersistentHandle(newInstance, peer, callback); | 583 Dart_NewWeakPersistentHandle(newInstance, peer, callback); |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 if (!v) { | 1111 if (!v) { |
| 1112 return 0; | 1112 return 0; |
| 1113 } | 1113 } |
| 1114 ASSERT(valueLen > 0 && static_cast<size_t>(valueLen) > strlen(v)); | 1114 ASSERT(valueLen > 0 && static_cast<size_t>(valueLen) > strlen(v)); |
| 1115 strncpy(value, v, valueLen); | 1115 strncpy(value, v, valueLen); |
| 1116 value[valueLen - 1] = '\0'; | 1116 value[valueLen - 1] = '\0'; |
| 1117 return strlen(value); | 1117 return strlen(value); |
| 1118 #endif | 1118 #endif |
| 1119 } | 1119 } |
| 1120 } | 1120 } |
| OLD | NEW |