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

Side by Side Diff: include/v8.h

Issue 236833009: Export [Dis]allowJavascriptExecutionScope (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | no next file » | 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 4081 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 4092
4093 // Prevent copying of Scope objects. 4093 // Prevent copying of Scope objects.
4094 Scope(const Scope&); 4094 Scope(const Scope&);
4095 Scope& operator=(const Scope&); 4095 Scope& operator=(const Scope&);
4096 }; 4096 };
4097 4097
4098 4098
4099 /** 4099 /**
4100 * Assert that no Javascript code is invoked. 4100 * Assert that no Javascript code is invoked.
4101 */ 4101 */
4102 class DisallowJavascriptExecutionScope { 4102 class V8_EXPORT DisallowJavascriptExecutionScope {
4103 public: 4103 public:
4104 enum OnFailure { CRASH_ON_FAILURE, THROW_ON_FAILURE }; 4104 enum OnFailure { CRASH_ON_FAILURE, THROW_ON_FAILURE };
4105 4105
4106 DisallowJavascriptExecutionScope(Isolate* isolate, OnFailure on_failure); 4106 DisallowJavascriptExecutionScope(Isolate* isolate, OnFailure on_failure);
4107 ~DisallowJavascriptExecutionScope(); 4107 ~DisallowJavascriptExecutionScope();
4108 4108
4109 private: 4109 private:
4110 bool on_failure_; 4110 bool on_failure_;
4111 void* internal_; 4111 void* internal_;
4112 4112
4113 // Prevent copying of Scope objects. 4113 // Prevent copying of Scope objects.
4114 DisallowJavascriptExecutionScope(const DisallowJavascriptExecutionScope&); 4114 DisallowJavascriptExecutionScope(const DisallowJavascriptExecutionScope&);
4115 DisallowJavascriptExecutionScope& operator=( 4115 DisallowJavascriptExecutionScope& operator=(
4116 const DisallowJavascriptExecutionScope&); 4116 const DisallowJavascriptExecutionScope&);
4117 }; 4117 };
4118 4118
4119 4119
4120 /** 4120 /**
4121 * Introduce exception to DisallowJavascriptExecutionScope. 4121 * Introduce exception to DisallowJavascriptExecutionScope.
4122 */ 4122 */
4123 class AllowJavascriptExecutionScope { 4123 class V8_EXPORT AllowJavascriptExecutionScope {
4124 public: 4124 public:
4125 explicit AllowJavascriptExecutionScope(Isolate* isolate); 4125 explicit AllowJavascriptExecutionScope(Isolate* isolate);
4126 ~AllowJavascriptExecutionScope(); 4126 ~AllowJavascriptExecutionScope();
4127 4127
4128 private: 4128 private:
4129 void* internal_throws_; 4129 void* internal_throws_;
4130 void* internal_assert_; 4130 void* internal_assert_;
4131 4131
4132 // Prevent copying of Scope objects. 4132 // Prevent copying of Scope objects.
4133 AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope&); 4133 AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope&);
(...skipping 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after
6631 */ 6631 */
6632 6632
6633 6633
6634 } // namespace v8 6634 } // namespace v8
6635 6635
6636 6636
6637 #undef TYPE_CHECK 6637 #undef TYPE_CHECK
6638 6638
6639 6639
6640 #endif // V8_H_ 6640 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698