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

Side by Side Diff: include/v8.h

Issue 101463003: Revert "Introduce API to temporarily interrupt long running JavaScript code." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 3900 matching lines...) Expand 10 before | Expand all | Expand 10 after
3911 3911
3912 enum GCCallbackFlags { 3912 enum GCCallbackFlags {
3913 kNoGCCallbackFlags = 0, 3913 kNoGCCallbackFlags = 0,
3914 kGCCallbackFlagCompacted = 1 << 0, 3914 kGCCallbackFlagCompacted = 1 << 0,
3915 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1 3915 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1
3916 }; 3916 };
3917 3917
3918 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); 3918 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags);
3919 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); 3919 typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags);
3920 3920
3921 typedef void (*InterruptCallback)(Isolate* isolate, void* data);
3922
3923 3921
3924 /** 3922 /**
3925 * Collection of V8 heap information. 3923 * Collection of V8 heap information.
3926 * 3924 *
3927 * Instances of this class can be passed to v8::V8::HeapStatistics to 3925 * Instances of this class can be passed to v8::V8::HeapStatistics to
3928 * get heap statistics from V8. 3926 * get heap statistics from V8.
3929 */ 3927 */
3930 class V8_EXPORT HeapStatistics { 3928 class V8_EXPORT HeapStatistics {
3931 public: 3929 public:
3932 HeapStatistics(); 3930 HeapStatistics();
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4169 */ 4167 */
4170 void AddGCEpilogueCallback( 4168 void AddGCEpilogueCallback(
4171 GCEpilogueCallback callback, GCType gc_type_filter = kGCTypeAll); 4169 GCEpilogueCallback callback, GCType gc_type_filter = kGCTypeAll);
4172 4170
4173 /** 4171 /**
4174 * This function removes callback which was installed by 4172 * This function removes callback which was installed by
4175 * AddGCEpilogueCallback function. 4173 * AddGCEpilogueCallback function.
4176 */ 4174 */
4177 void RemoveGCEpilogueCallback(GCEpilogueCallback callback); 4175 void RemoveGCEpilogueCallback(GCEpilogueCallback callback);
4178 4176
4179 /**
4180 * Request V8 to interrupt long running JavaScript code and invoke
4181 * the given |callback| passing the given |data| to it. After |callback|
4182 * returns control will be returned to the JavaScript code.
4183 * At any given moment V8 can remember only a single callback for the very
4184 * last interrupt request.
4185 * Can be called from another thread without acquiring a |Locker|.
4186 * Registered |callback| must not reenter interrupted Isolate.
4187 */
4188 void RequestInterrupt(InterruptCallback callback, void* data);
4189
4190 /**
4191 * Clear interrupt request created by |RequestInterrupt|.
4192 * Can be called from another thread without acquiring a |Locker|.
4193 */
4194 void ClearInterrupt();
4195
4196 private: 4177 private:
4197 Isolate(); 4178 Isolate();
4198 Isolate(const Isolate&); 4179 Isolate(const Isolate&);
4199 ~Isolate(); 4180 ~Isolate();
4200 Isolate& operator=(const Isolate&); 4181 Isolate& operator=(const Isolate&);
4201 void* operator new(size_t size); 4182 void* operator new(size_t size);
4202 void operator delete(void*, size_t); 4183 void operator delete(void*, size_t);
4203 4184
4204 void SetObjectGroupId(internal::Object** object, UniqueId id); 4185 void SetObjectGroupId(internal::Object** object, UniqueId id);
4205 void SetReferenceFromGroup(UniqueId id, internal::Object** object); 4186 void SetReferenceFromGroup(UniqueId id, internal::Object** object);
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after
6455 */ 6436 */
6456 6437
6457 6438
6458 } // namespace v8 6439 } // namespace v8
6459 6440
6460 6441
6461 #undef TYPE_CHECK 6442 #undef TYPE_CHECK
6462 6443
6463 6444
6464 #endif // V8_H_ 6445 #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