Roll src/third_party/WebKit 5dc6c7a:f688398 (svn 201993:201994)
[chromium-blink-merge.git] / gin / try_catch.h
blob84b2ae1646560eb41bf221f78b34e7d3ae64d68f
1 // Copyright 2013 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.
5 #ifndef GIN_TRY_CATCH_H_
6 #define GIN_TRY_CATCH_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "gin/gin_export.h"
12 #include "v8/include/v8.h"
14 namespace gin {
16 // TryCatch is a convenient wrapper around v8::TryCatch.
17 class GIN_EXPORT TryCatch {
18 public:
19 explicit TryCatch(v8::Isolate* isolate);
20 ~TryCatch();
22 bool HasCaught();
23 std::string GetStackTrace();
25 private:
26 v8::Isolate* isolate_;
27 v8::TryCatch try_catch_;
29 DISALLOW_COPY_AND_ASSIGN(TryCatch);
32 } // namespace gin
34 #endif // GIN_TRY_CATCH_H_