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

Side by Side Diff: Source/bindings/core/v8/V8Binding.h

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.cpp ('k') | Source/bindings/core/v8/V8BindingMacros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 ~V8RethrowTryCatchScope() 955 ~V8RethrowTryCatchScope()
956 { 956 {
957 // ReThrow() is a no-op if no exception has been caught, so always call. 957 // ReThrow() is a no-op if no exception has been caught, so always call.
958 m_block.ReThrow(); 958 m_block.ReThrow();
959 } 959 }
960 960
961 private: 961 private:
962 v8::TryCatch& m_block; 962 v8::TryCatch& m_block;
963 }; 963 };
964 964
965 class V8ResetTryCatchScope FINAL {
966 public:
967 explicit V8ResetTryCatchScope(v8::TryCatch& block) : m_block(block) { }
968 ~V8ResetTryCatchScope()
969 {
970 m_block.Reset();
971 }
972
973 private:
974 v8::TryCatch& m_block;
975 };
976
977 } // namespace blink 965 } // namespace blink
978 966
979 #endif // V8Binding_h 967 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.cpp ('k') | Source/bindings/core/v8/V8BindingMacros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698