Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: Source/bindings/v8/V8Binding.h

Issue 304223007: Use auto-rethrowing v8::TryCatch variant (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make constructors explicit Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/V8BindingMacros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8Binding.h
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h
index 4e093882fb9e78b7b13b8db4ca8340eb4a9426c6..7b7c79f10acca0d6f1e2fa9e04eaf1795f325324 100644
--- a/Source/bindings/v8/V8Binding.h
+++ b/Source/bindings/v8/V8Binding.h
@@ -940,6 +940,30 @@ private:
void GetDevToolsFunctionInfo(v8::Handle<v8::Function>, v8::Isolate*, int& scriptId, String& resourceName, int& lineNumber);
PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(ExecutionContext*, v8::Handle<v8::Function>, v8::Isolate*);
+class V8RethrowTryCatchScope FINAL {
+public:
+ explicit V8RethrowTryCatchScope(v8::TryCatch& block) : m_block(block) { }
+ ~V8RethrowTryCatchScope()
+ {
+ // ReThrow() is a no-op if no exception has been caught, so always call.
+ m_block.ReThrow();
+ }
+
+private:
+ v8::TryCatch& m_block;
+};
+
+class V8ResetTryCatchScope FINAL {
+public:
+ explicit V8ResetTryCatchScope(v8::TryCatch& block) : m_block(block) { }
+ ~V8ResetTryCatchScope()
+ {
+ m_block.Reset();
+ }
+
+private:
+ v8::TryCatch& m_block;
+};
} // namespace WebCore
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/V8BindingMacros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698