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

Side by Side Diff: include/v8.h

Issue 203223013: Introduce API to trigger exception on JS execution. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4072 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 Scope(const Scope&); 4083 Scope(const Scope&);
4084 Scope& operator=(const Scope&); 4084 Scope& operator=(const Scope&);
4085 }; 4085 };
4086 4086
4087 4087
4088 /** 4088 /**
4089 * Assert that no Javascript code is invoked. 4089 * Assert that no Javascript code is invoked.
4090 */ 4090 */
4091 class DisallowJavascriptExecutionScope { 4091 class DisallowJavascriptExecutionScope {
4092 public: 4092 public:
4093 explicit DisallowJavascriptExecutionScope(Isolate* isolate); 4093 enum OnFailure { CRASH_ON_FAILURE, THROW_ON_FAILURE };
4094
4095 explicit DisallowJavascriptExecutionScope(Isolate* isolate,
tfarina 2014/03/19 19:14:16 remove explicit? not needed anymore, right?
4096 OnFailure on_failure);
4094 ~DisallowJavascriptExecutionScope(); 4097 ~DisallowJavascriptExecutionScope();
4095 4098
4096 private: 4099 private:
4100 bool on_failure_;
4097 void* internal_; 4101 void* internal_;
4098 4102
4099 // Prevent copying of Scope objects. 4103 // Prevent copying of Scope objects.
4100 DisallowJavascriptExecutionScope(const DisallowJavascriptExecutionScope&); 4104 DisallowJavascriptExecutionScope(const DisallowJavascriptExecutionScope&);
4101 DisallowJavascriptExecutionScope& operator=( 4105 DisallowJavascriptExecutionScope& operator=(
4102 const DisallowJavascriptExecutionScope&); 4106 const DisallowJavascriptExecutionScope&);
4103 }; 4107 };
4104 4108
4105 4109
4106 /** 4110 /**
4107 * Introduce exception to DisallowJavascriptExecutionScope. 4111 * Introduce exception to DisallowJavascriptExecutionScope.
4108 */ 4112 */
4109 class AllowJavascriptExecutionScope { 4113 class AllowJavascriptExecutionScope {
4110 public: 4114 public:
4111 explicit AllowJavascriptExecutionScope(Isolate* isolate); 4115 explicit AllowJavascriptExecutionScope(Isolate* isolate);
4112 ~AllowJavascriptExecutionScope(); 4116 ~AllowJavascriptExecutionScope();
4113 4117
4114 private: 4118 private:
4115 void* internal_; 4119 void* internal_throws_;
4120 void* internal_assert_;
4121
4122 // Prevent copying of Scope objects.
4123 AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope&);
4124 AllowJavascriptExecutionScope& operator=(
4125 const AllowJavascriptExecutionScope&);
4116 }; 4126 };
4117 4127
4118 /** 4128 /**
4119 * Types of garbage collections that can be requested via 4129 * Types of garbage collections that can be requested via
4120 * RequestGarbageCollectionForTesting. 4130 * RequestGarbageCollectionForTesting.
4121 */ 4131 */
4122 enum GarbageCollectionType { 4132 enum GarbageCollectionType {
4123 kFullGarbageCollection, 4133 kFullGarbageCollection,
4124 kMinorGarbageCollection 4134 kMinorGarbageCollection
4125 }; 4135 };
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
6573 */ 6583 */
6574 6584
6575 6585
6576 } // namespace v8 6586 } // namespace v8
6577 6587
6578 6588
6579 #undef TYPE_CHECK 6589 #undef TYPE_CHECK
6580 6590
6581 6591
6582 #endif // V8_H_ 6592 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698