blob: da3d2b276c6aeccc743ead0b4895526fe1d7801d [file] [log] [blame]
John McCutchan080c33e2015-07-16 12:35:35 -07001// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
John McCutchanc27a98c2015-07-21 11:25:24 -07005#ifndef TONIC_DART_API_SCOPE_H_
6#define TONIC_DART_API_SCOPE_H_
John McCutchan080c33e2015-07-16 12:35:35 -07007
8#include "base/macros.h"
9#include "dart/runtime/include/dart_api.h"
10
John McCutchandeace8f2015-07-21 08:01:40 -070011namespace tonic {
John McCutchan080c33e2015-07-16 12:35:35 -070012
13class DartApiScope {
14 public:
15 DartApiScope() { Dart_EnterScope(); }
16 ~DartApiScope() { Dart_ExitScope(); }
17
18 private:
19 DISALLOW_COPY_AND_ASSIGN(DartApiScope);
20};
21
John McCutchandeace8f2015-07-21 08:01:40 -070022} // namespace tonic
John McCutchan080c33e2015-07-16 12:35:35 -070023
John McCutchanc27a98c2015-07-21 11:25:24 -070024#endif // TONIC_DART_API_SCOPE_H_