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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2571563005: Turn the VM's dart:typed_data into a patch (Closed)
Patch Set: Fix interface/implementation type mismatch Created 3 years, 12 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
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 3521 matching lines...) Expand 10 before | Expand all | Expand 10 after
3532 3532
3533 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { 3533 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) {
3534 DARTSCOPE(Thread::Current()); 3534 DARTSCOPE(Thread::Current());
3535 intptr_t class_id = Api::ClassId(typed_data); 3535 intptr_t class_id = Api::ClassId(typed_data);
3536 if (!RawObject::IsExternalTypedDataClassId(class_id) && 3536 if (!RawObject::IsExternalTypedDataClassId(class_id) &&
3537 !RawObject::IsTypedDataViewClassId(class_id) && 3537 !RawObject::IsTypedDataViewClassId(class_id) &&
3538 !RawObject::IsTypedDataClassId(class_id)) { 3538 !RawObject::IsTypedDataClassId(class_id)) {
3539 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); 3539 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData');
3540 } 3540 }
3541 Object& result = Object::Handle(Z); 3541 Object& result = Object::Handle(Z);
3542 result = GetByteBufferConstructor(T, Symbols::ByteBuffer(), 3542 result = GetByteBufferConstructor(T, Symbols::_ByteBuffer(),
3543 Symbols::ByteBufferDot_New(), 1); 3543 Symbols::_ByteBufferDot_New(), 1);
3544 ASSERT(!result.IsNull()); 3544 ASSERT(!result.IsNull());
3545 ASSERT(result.IsFunction()); 3545 ASSERT(result.IsFunction());
3546 const Function& factory = Function::Cast(result); 3546 const Function& factory = Function::Cast(result);
3547 ASSERT(!factory.IsGenerativeConstructor()); 3547 ASSERT(!factory.IsGenerativeConstructor());
3548 3548
3549 // Create the argument list. 3549 // Create the argument list.
3550 const Array& args = Array::Handle(Z, Array::New(2)); 3550 const Array& args = Array::Handle(Z, Array::New(2));
3551 // Factories get type arguments. 3551 // Factories get type arguments.
3552 args.SetAt(0, Object::null_type_arguments()); 3552 args.SetAt(0, Object::null_type_arguments());
3553 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data)); 3553 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data));
(...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after
6815 } 6815 }
6816 6816
6817 6817
6818 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6818 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6819 #ifndef PRODUCT 6819 #ifndef PRODUCT
6820 Profiler::DumpStackTrace(context); 6820 Profiler::DumpStackTrace(context);
6821 #endif 6821 #endif
6822 } 6822 }
6823 6823
6824 } // namespace dart 6824 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698