[M120 Migration] Set IO|GPU thread type with higher priorites
[platform/framework/web/chromium-efl.git] / gin / try_catch.h
1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GIN_TRY_CATCH_H_
6 #define GIN_TRY_CATCH_H_
7
8 #include <string>
9
10 #include "base/memory/raw_ptr.h"
11 #include "gin/gin_export.h"
12 #include "v8/include/v8-exception.h"
13
14 namespace gin {
15
16 // TryCatch is a convenient wrapper around v8::TryCatch.
17 class GIN_EXPORT TryCatch {
18  public:
19   explicit TryCatch(v8::Isolate* isolate);
20   TryCatch(const TryCatch&) = delete;
21   TryCatch& operator=(const TryCatch&) = delete;
22   ~TryCatch();
23
24   bool HasCaught();
25   std::string GetStackTrace();
26
27  private:
28   raw_ptr<v8::Isolate> isolate_;
29   v8::TryCatch try_catch_;
30 };
31
32 }  // namespace gin
33
34 #endif  // GIN_TRY_CATCH_H_