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

Side by Side Diff: include/v8.h

Issue 263933002: Introduce a microtask suppression scope and move microtask methods to isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 7 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 // 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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 4095 matching lines...) Expand 10 before | Expand all | Expand 10 after
4106 void* internal_throws_; 4106 void* internal_throws_;
4107 void* internal_assert_; 4107 void* internal_assert_;
4108 4108
4109 // Prevent copying of Scope objects. 4109 // Prevent copying of Scope objects.
4110 AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope&); 4110 AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope&);
4111 AllowJavascriptExecutionScope& operator=( 4111 AllowJavascriptExecutionScope& operator=(
4112 const AllowJavascriptExecutionScope&); 4112 const AllowJavascriptExecutionScope&);
4113 }; 4113 };
4114 4114
4115 /** 4115 /**
4116 * Do not run microtasks while this scope is active, even if microtasks are
4117 * automatically executed otherwise.
4118 */
4119 class V8_EXPORT SuppressMicrotaskExecutionScope {
4120 public:
4121 explicit SuppressMicrotaskExecutionScope(Isolate* isolate);
4122 ~SuppressMicrotaskExecutionScope();
4123
4124 private:
4125 internal::Isolate* isolate_;
4126
4127 // Prevent copying of Scope objects.
4128 SuppressMicrotaskExecutionScope(const SuppressMicrotaskExecutionScope&);
4129 SuppressMicrotaskExecutionScope& operator=(
4130 const SuppressMicrotaskExecutionScope&);
4131 };
4132
4133 /**
4116 * Types of garbage collections that can be requested via 4134 * Types of garbage collections that can be requested via
4117 * RequestGarbageCollectionForTesting. 4135 * RequestGarbageCollectionForTesting.
4118 */ 4136 */
4119 enum GarbageCollectionType { 4137 enum GarbageCollectionType {
4120 kFullGarbageCollection, 4138 kFullGarbageCollection,
4121 kMinorGarbageCollection 4139 kMinorGarbageCollection
4122 }; 4140 };
4123 4141
4124 /** 4142 /**
4125 * Creates a new isolate. Does not change the currently entered 4143 * Creates a new isolate. Does not change the currently entered
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
4354 * execution ends. Executing scripts inside the callback do not trigger 4372 * execution ends. Executing scripts inside the callback do not trigger
4355 * further callbacks. 4373 * further callbacks.
4356 */ 4374 */
4357 void AddCallCompletedCallback(CallCompletedCallback callback); 4375 void AddCallCompletedCallback(CallCompletedCallback callback);
4358 4376
4359 /** 4377 /**
4360 * Removes callback that was installed by AddCallCompletedCallback. 4378 * Removes callback that was installed by AddCallCompletedCallback.
4361 */ 4379 */
4362 void RemoveCallCompletedCallback(CallCompletedCallback callback); 4380 void RemoveCallCompletedCallback(CallCompletedCallback callback);
4363 4381
4382 /**
4383 * Experimental: Runs the Microtask Work Queue until empty
4384 */
4385 void RunMicrotasks();
4386
4387 /**
4388 * Experimental: Enqueues the callback to the Microtask Work Queue
4389 */
4390 void EnqueueMicrotask(Handle<Function> microtask);
4391
4392 /**
4393 * Experimental: Controls whether the Microtask Work Queue is automatically
4394 * run when the script call depth decrements to zero.
4395 */
4396 void SetAutorunMicrotasks(bool autorun);
4397
4364 private: 4398 private:
4365 template<class K, class V, class Traits> friend class PersistentValueMap; 4399 template<class K, class V, class Traits> friend class PersistentValueMap;
4366 4400
4367 Isolate(); 4401 Isolate();
4368 Isolate(const Isolate&); 4402 Isolate(const Isolate&);
4369 ~Isolate(); 4403 ~Isolate();
4370 Isolate& operator=(const Isolate&); 4404 Isolate& operator=(const Isolate&);
4371 void* operator new(size_t size); 4405 void* operator new(size_t size);
4372 void operator delete(void*, size_t); 4406 void operator delete(void*, size_t);
4373 4407
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 ObjectSpace space, 4751 ObjectSpace space,
4718 AllocationAction action); 4752 AllocationAction action);
4719 4753
4720 /** 4754 /**
4721 * Removes callback that was installed by AddMemoryAllocationCallback. 4755 * Removes callback that was installed by AddMemoryAllocationCallback.
4722 */ 4756 */
4723 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); 4757 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback);
4724 4758
4725 /** 4759 /**
4726 * Experimental: Runs the Microtask Work Queue until empty 4760 * Experimental: Runs the Microtask Work Queue until empty
4761 *
4762 * Deprecated: Use methods on Isolate instead.
4727 */ 4763 */
4728 static void RunMicrotasks(Isolate* isolate); 4764 static void RunMicrotasks(Isolate* isolate);
4729 4765
4730 /** 4766 /**
4731 * Experimental: Enqueues the callback to the Microtask Work Queue 4767 * Experimental: Enqueues the callback to the Microtask Work Queue
4768 *
4769 * Deprecated: Use methods on Isolate instead.
4732 */ 4770 */
4733 static void EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask); 4771 static void EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask);
4734 4772
4735 /** 4773 /**
4736 * Experimental: Controls whether the Microtask Work Queue is automatically 4774 * Experimental: Controls whether the Microtask Work Queue is automatically
4737 * run when the script call depth decrements to zero. 4775 * run when the script call depth decrements to zero.
4776 *
4777 * Deprecated: Use methods on Isolate instead.
4738 */ 4778 */
4739 static void SetAutorunMicrotasks(Isolate *source, bool autorun); 4779 static void SetAutorunMicrotasks(Isolate *source, bool autorun);
4740 4780
4741 /** 4781 /**
4742 * Initializes from snapshot if possible. Otherwise, attempts to 4782 * Initializes from snapshot if possible. Otherwise, attempts to
4743 * initialize from scratch. This function is called implicitly if 4783 * initialize from scratch. This function is called implicitly if
4744 * you use the API without calling it first. 4784 * you use the API without calling it first.
4745 */ 4785 */
4746 static bool Initialize(); 4786 static bool Initialize();
4747 4787
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
6589 */ 6629 */
6590 6630
6591 6631
6592 } // namespace v8 6632 } // namespace v8
6593 6633
6594 6634
6595 #undef TYPE_CHECK 6635 #undef TYPE_CHECK
6596 6636
6597 6637
6598 #endif // V8_H_ 6638 #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