Commit 36ba52d6 authored by raymes's avatar raymes Committed by Commit bot

Remove NOTREACHED verifying no previous exceptions are set in PepperTryCatch

When setting an exception we check that no other exceptions have been set.
However, sometimes it is preferable not to bail out of the
codepath immediately because the code becomes messier. In particular, if
the context is destroyed, an exception will be set which can happen upon
construction of the try/catch. Keeping this NOTREACHED means that we have to check
for an exception after the construction of every try/catch. I can't see a
problem with not checking the exception immediately - other operations will
fail and the result of the try-catch will eventually be set.

BUG=303491

Review URL: https://codereview.chromium.org/554173002

Cr-Commit-Position: refs/heads/master@{#294046}
parent ba21e464
...@@ -109,10 +109,9 @@ void PepperTryCatchV8::ThrowException(const char* message) { ...@@ -109,10 +109,9 @@ void PepperTryCatchV8::ThrowException(const char* message) {
} }
void PepperTryCatchV8::SetException(const char* message) { void PepperTryCatchV8::SetException(const char* message) {
if (HasException()) { if (HasException())
NOTREACHED();
return; return;
}
exception_ = ppapi::StringVar::StringToPPVar(message); exception_ = ppapi::StringVar::StringToPPVar(message);
} }
...@@ -156,10 +155,9 @@ bool PepperTryCatchVar::HasException() { ...@@ -156,10 +155,9 @@ bool PepperTryCatchVar::HasException() {
} }
void PepperTryCatchVar::SetException(const char* message) { void PepperTryCatchVar::SetException(const char* message) {
if (exception_is_set_) { if (exception_is_set_)
NOTREACHED();
return; return;
}
if (exception_) if (exception_)
*exception_ = ppapi::StringVar::StringToPPVar(message, strlen(message)); *exception_ = ppapi::StringVar::StringToPPVar(message, strlen(message));
exception_is_set_ = true; exception_is_set_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment