V8 Project
v8::Isolate::DisallowJavascriptExecutionScope Class Reference

Assert that no Javascript code is invoked. More...

#include <v8.h>

+ Collaboration diagram for v8::Isolate::DisallowJavascriptExecutionScope:

Public Types

enum  OnFailure { CRASH_ON_FAILURE , THROW_ON_FAILURE }
 

Public Member Functions

 DisallowJavascriptExecutionScope (Isolate *isolate, OnFailure on_failure)
 
 ~DisallowJavascriptExecutionScope ()
 

Private Member Functions

 DisallowJavascriptExecutionScope (const DisallowJavascriptExecutionScope &)
 
DisallowJavascriptExecutionScopeoperator= (const DisallowJavascriptExecutionScope &)
 

Private Attributes

bool on_failure_
 
void * internal_
 

Detailed Description

Assert that no Javascript code is invoked.

Definition at line 4418 of file v8.h.

Member Enumeration Documentation

◆ OnFailure

Enumerator
CRASH_ON_FAILURE 
THROW_ON_FAILURE 

Definition at line 4420 of file v8.h.

Constructor & Destructor Documentation

◆ DisallowJavascriptExecutionScope() [1/2]

v8::Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope ( Isolate isolate,
OnFailure  on_failure 
)

Definition at line 6632 of file api.cc.

6635  : on_failure_(on_failure) {
6636  i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
6637  if (on_failure_ == CRASH_ON_FAILURE) {
6638  internal_ = reinterpret_cast<void*>(
6639  new i::DisallowJavascriptExecution(i_isolate));
6640  } else {
6641  DCHECK_EQ(THROW_ON_FAILURE, on_failure);
6642  internal_ = reinterpret_cast<void*>(
6643  new i::ThrowOnJavascriptExecution(i_isolate));
6644  }
6645 }
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206
PerIsolateAssertScope< JAVASCRIPT_EXECUTION_THROWS, false > ThrowOnJavascriptExecution
Definition: assert-scope.h:153
PerIsolateAssertScope< JAVASCRIPT_EXECUTION_ASSERT, false > DisallowJavascriptExecution
Definition: assert-scope.h:145

References CRASH_ON_FAILURE, DCHECK_EQ, internal_, on_failure_, and THROW_ON_FAILURE.

◆ ~DisallowJavascriptExecutionScope()

v8::Isolate::DisallowJavascriptExecutionScope::~DisallowJavascriptExecutionScope ( )

Definition at line 6648 of file api.cc.

6648  {
6649  if (on_failure_ == CRASH_ON_FAILURE) {
6650  delete reinterpret_cast<i::DisallowJavascriptExecution*>(internal_);
6651  } else {
6652  delete reinterpret_cast<i::ThrowOnJavascriptExecution*>(internal_);
6653  }
6654 }

◆ DisallowJavascriptExecutionScope() [2/2]

v8::Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope ( const DisallowJavascriptExecutionScope )
private

Member Function Documentation

◆ operator=()

DisallowJavascriptExecutionScope& v8::Isolate::DisallowJavascriptExecutionScope::operator= ( const DisallowJavascriptExecutionScope )
private

Member Data Documentation

◆ internal_

void* v8::Isolate::DisallowJavascriptExecutionScope::internal_
private

Definition at line 4427 of file v8.h.

Referenced by DisallowJavascriptExecutionScope().

◆ on_failure_

bool v8::Isolate::DisallowJavascriptExecutionScope::on_failure_
private

Definition at line 4426 of file v8.h.

Referenced by DisallowJavascriptExecutionScope().


The documentation for this class was generated from the following files: