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

Side by Side Diff: src/isolate.cc

Issue 249313002: Remove static CallCompletedCallback handlers (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 | « src/isolate.h ('k') | src/v8.h » ('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 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2249 Handle<String> name = factory()->InternalizeUtf8String(nested[i]); 2249 Handle<String> name = factory()->InternalizeUtf8String(nested[i]);
2250 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); 2250 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map);
2251 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); 2251 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8);
2252 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); 2252 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert();
2253 } 2253 }
2254 } 2254 }
2255 return Handle<JSObject>::cast(factory()->symbol_registry()); 2255 return Handle<JSObject>::cast(factory()->symbol_registry());
2256 } 2256 }
2257 2257
2258 2258
2259 void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) {
2260 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
2261 if (callback == call_completed_callbacks_.at(i)) return;
2262 }
2263 call_completed_callbacks_.Add(callback);
2264 }
2265
2266
2267 void Isolate::RemoveCallCompletedCallback(CallCompletedCallback callback) {
2268 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
2269 if (callback == call_completed_callbacks_.at(i)) {
2270 call_completed_callbacks_.Remove(i);
2271 }
2272 }
2273 }
2274
2275
2276 void Isolate::FireCallCompletedCallback() {
2277 bool has_call_completed_callbacks = !call_completed_callbacks_.is_empty();
2278 bool run_microtasks = autorun_microtasks() && microtask_pending();
2279 if (!has_call_completed_callbacks && !run_microtasks) return;
2280
2281 if (!handle_scope_implementer()->CallDepthIsZero()) return;
Sven Panne 2014/04/24 07:08:21 This code has just moved, but nevertheless: I don'
Yang 2014/04/24 07:16:38 Agree. This should just be moved into the isolate.
2282 // Fire callbacks. Increase call depth to prevent recursive callbacks.
2283 handle_scope_implementer()->IncrementCallDepth();
2284 if (run_microtasks) Execution::RunMicrotasks(this);
2285 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
2286 call_completed_callbacks_.at(i)();
2287 }
2288 handle_scope_implementer()->DecrementCallDepth();
2289 }
2290
2291
2259 } } // namespace v8::internal 2292 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698