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

Side by Side Diff: src/api.cc

Issue 1375933003: Add SetAbortOnUncaughtExceptionCallback API (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 7085 matching lines...) Expand 10 before | Expand all | Expand 10 after
7096 void Isolate::Enter() { 7096 void Isolate::Enter() {
7097 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7097 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7098 isolate->Enter(); 7098 isolate->Enter();
7099 } 7099 }
7100 7100
7101 7101
7102 void Isolate::Exit() { 7102 void Isolate::Exit() {
7103 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7103 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7104 isolate->Exit(); 7104 isolate->Exit();
7105 } 7105 }
7106 7106
Michael Starzinger 2015/10/01 16:34:38 nit: Two empty newlines between top-level declarat
julien.gilli 2015/10/01 19:18:11 Acknowledged.
julien.gilli 2015/10/01 19:18:11 For some reason, it seems tools/presubmit.py didn'
julien.gilli 2015/10/05 17:24:24 Done.
7107 void Isolate::SetAbortOnUncaughtExceptionCallback(
7108 AbortOnUncaughtExceptionCallback callback) {
7109 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7110 isolate->SetAbortOnUncaughtExceptionCallback(callback);
7111 }
7107 7112
Michael Starzinger 2015/10/01 16:34:38 nit: Two empty newlines between top-level declarat
julien.gilli 2015/10/01 19:18:11 Acknowledged.
julien.gilli 2015/10/05 17:24:24 Done.
7108 Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope( 7113 Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope(
7109 Isolate* isolate, 7114 Isolate* isolate,
7110 Isolate::DisallowJavascriptExecutionScope::OnFailure on_failure) 7115 Isolate::DisallowJavascriptExecutionScope::OnFailure on_failure)
7111 : on_failure_(on_failure) { 7116 : on_failure_(on_failure) {
7112 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 7117 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
7113 if (on_failure_ == CRASH_ON_FAILURE) { 7118 if (on_failure_ == CRASH_ON_FAILURE) {
7114 internal_ = reinterpret_cast<void*>( 7119 internal_ = reinterpret_cast<void*>(
7115 new i::DisallowJavascriptExecution(i_isolate)); 7120 new i::DisallowJavascriptExecution(i_isolate));
7116 } else { 7121 } else {
7117 DCHECK_EQ(THROW_ON_FAILURE, on_failure); 7122 DCHECK_EQ(THROW_ON_FAILURE, on_failure);
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
8357 Address callback_address = 8362 Address callback_address =
8358 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8363 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8359 VMState<EXTERNAL> state(isolate); 8364 VMState<EXTERNAL> state(isolate);
8360 ExternalCallbackScope call_scope(isolate, callback_address); 8365 ExternalCallbackScope call_scope(isolate, callback_address);
8361 callback(info); 8366 callback(info);
8362 } 8367 }
8363 8368
8364 8369
8365 } // namespace internal 8370 } // namespace internal
8366 } // namespace v8 8371 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698