| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/tonic/dart_builtin.h" | 6 #include "sky/engine/tonic/dart_builtin.h" |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "sky/engine/tonic/dart_converter.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 DartBuiltin::DartBuiltin(const Natives* natives, size_t count) | 16 DartBuiltin::DartBuiltin(const Natives* natives, size_t count) |
| 16 : natives_(natives), count_(count) { | 17 : natives_(natives), count_(count) { |
| 17 } | 18 } |
| 18 | 19 |
| 19 DartBuiltin::~DartBuiltin() { | 20 DartBuiltin::~DartBuiltin() { |
| 20 } | 21 } |
| 21 | 22 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 const uint8_t* DartBuiltin::Symbolizer(Dart_NativeFunction native_function) cons
t { | 42 const uint8_t* DartBuiltin::Symbolizer(Dart_NativeFunction native_function) cons
t { |
| 42 for (size_t i = 0; i < count_; ++i) { | 43 for (size_t i = 0; i < count_; ++i) { |
| 43 const Natives& entry = natives_[i]; | 44 const Natives& entry = natives_[i]; |
| 44 if (entry.function == native_function) | 45 if (entry.function == native_function) |
| 45 return reinterpret_cast<const uint8_t*>(entry.name); | 46 return reinterpret_cast<const uint8_t*>(entry.name); |
| 46 } | 47 } |
| 47 return nullptr; | 48 return nullptr; |
| 48 } | 49 } |
| 49 | 50 |
| 51 Dart_Handle DartBuiltin::LookupLibrary(const char* name) { |
| 52 Dart_Handle library = Dart_LookupLibrary(ToDart(name)); |
| 53 DCHECK(!Dart_IsError(library)); |
| 54 return library; |
| 55 } |
| 56 |
| 50 } // namespace blink | 57 } // namespace blink |
| OLD | NEW |