Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 v8::HandleScope m_handleScope; | 945 v8::HandleScope m_handleScope; |
| 946 v8::Context::Scope m_contextScope; | 946 v8::Context::Scope m_contextScope; |
| 947 RefPtr<ScriptState> m_scriptState; | 947 RefPtr<ScriptState> m_scriptState; |
| 948 }; | 948 }; |
| 949 | 949 |
| 950 void GetDevToolsFunctionInfo(v8::Handle<v8::Function>, v8::Isolate*, int& script Id, String& resourceName, int& lineNumber); | 950 void GetDevToolsFunctionInfo(v8::Handle<v8::Function>, v8::Isolate*, int& script Id, String& resourceName, int& lineNumber); |
| 951 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext*, v8::Handle<v8::Function>, v8::Isolate*); | 951 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext*, v8::Handle<v8::Function>, v8::Isolate*); |
| 952 | 952 |
| 953 class V8RethrowTryCatchScope FINAL { | 953 class V8RethrowTryCatchScope FINAL { |
| 954 public: | 954 public: |
| 955 explicit V8RethrowTryCatchScope(v8::TryCatch& block) : m_block(block) { } | 955 explicit V8RethrowTryCatchScope(v8::TryCatch& block) : m_block(block), m_isC anceled(false) { } |
| 956 void cancel() { m_isCanceled = true; } | |
| 956 ~V8RethrowTryCatchScope() | 957 ~V8RethrowTryCatchScope() |
| 957 { | 958 { |
| 958 // ReThrow() is a no-op if no exception has been caught, so always call. | 959 if (!m_isCanceled) { |
| 959 m_block.ReThrow(); | 960 // ReThrow() is a no-op if no exception has been caught, so always c all. |
| 961 m_block.ReThrow(); | |
| 962 } | |
| 960 } | 963 } |
| 961 | 964 |
| 962 private: | 965 private: |
| 963 v8::TryCatch& m_block; | 966 v8::TryCatch& m_block; |
| 964 }; | 967 bool m_isCanceled; |
| 965 | |
| 966 class V8ResetTryCatchScope FINAL { | |
|
yhirano
2014/07/30 10:04:03
This class was introduced to cancel v8::TryCatch r
| |
| 967 public: | |
| 968 explicit V8ResetTryCatchScope(v8::TryCatch& block) : m_block(block) { } | |
| 969 ~V8ResetTryCatchScope() | |
| 970 { | |
| 971 m_block.Reset(); | |
| 972 } | |
| 973 | |
| 974 private: | |
| 975 v8::TryCatch& m_block; | |
| 976 }; | 968 }; |
| 977 | 969 |
| 978 } // namespace blink | 970 } // namespace blink |
| 979 | 971 |
| 980 #endif // V8Binding_h | 972 #endif // V8Binding_h |
| OLD | NEW |