| 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 "tonic/dart_gc_controller.h" | 5 #include "tonic/dart_gc_controller.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "dart/runtime/include/dart_api.h" | 8 #include "dart/runtime/include/dart_api.h" |
| 9 #include "tonic/dart_gc_context.h" | 9 #include "tonic/dart_gc_context.h" |
| 10 #include "tonic/dart_gc_visitor.h" | 10 #include "tonic/dart_gc_visitor.h" |
| 11 #include "tonic/dart_wrappable.h" | 11 #include "tonic/dart_wrappable.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace tonic { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 DartGCContext* g_gc_context = nullptr; | 16 DartGCContext* g_gc_context = nullptr; |
| 17 | 17 |
| 18 DartWrappable* GetWrappable(intptr_t* fields) { | 18 DartWrappable* GetWrappable(intptr_t* fields) { |
| 19 return reinterpret_cast<DartWrappable*>(fields[DartWrappable::kPeerIndex]); | 19 return reinterpret_cast<DartWrappable*>(fields[DartWrappable::kPeerIndex]); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void Visit(void* isolate_callback_data, | 22 void Visit(void* isolate_callback_data, |
| 23 Dart_WeakPersistentHandle handle, | 23 Dart_WeakPersistentHandle handle, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 void DartGCEpilogue() { | 44 void DartGCEpilogue() { |
| 45 delete g_gc_context; | 45 delete g_gc_context; |
| 46 g_gc_context = nullptr; | 46 g_gc_context = nullptr; |
| 47 Dart_ExitScope(); | 47 Dart_ExitScope(); |
| 48 | 48 |
| 49 TRACE_EVENT_ASYNC_END0("sky", "DartGC", 0); | 49 TRACE_EVENT_ASYNC_END0("sky", "DartGC", 0); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace blink | 52 } // namespace tonic |
| OLD | NEW |