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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1502093002: Improve ScriptForbiddenScope handling in cross-threaded code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased up past r363426 Created 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/ScriptForbiddenScope.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC"); 274 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8MajorGC");
275 } else { 275 } else {
276 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos); 276 objectGroupingForMajorGC(isolate, constructRetainedObjectInfos);
277 } 277 }
278 } 278 }
279 279
280 } 280 }
281 281
282 void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCal lbackFlags flags) 282 void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCal lbackFlags flags)
283 { 283 {
284 if (isMainThread()) { 284 if (isMainThread())
285 ScriptForbiddenScope::enter(); 285 ScriptForbiddenScope::enter();
286 }
287 286
288 // TODO(haraken): It is not safe to run finalizers in a prologue callback 287 // TODO(haraken): It is not safe to run finalizers in a prologue callback
289 // because V8AbstractEventListener's destructor cann call into V8. We 288 // because V8AbstractEventListener's destructor cann call into V8. We
290 // should post a task to schedule willStartV8GC() and avoid running it 289 // should post a task to schedule willStartV8GC() and avoid running it
291 // inside the prologue callback. 290 // inside the prologue callback.
292 // if (ThreadState::current()) 291 // if (ThreadState::current())
293 // ThreadState::current()->willStartV8GC(); 292 // ThreadState::current()->willStartV8GC();
294 293
295 v8::HandleScope scope(isolate); 294 v8::HandleScope scope(isolate);
296 switch (type) { 295 switch (type) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 Visitor* m_visitor; 443 Visitor* m_visitor;
445 }; 444 };
446 445
447 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) 446 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor)
448 { 447 {
449 DOMWrapperTracer tracer(visitor); 448 DOMWrapperTracer tracer(visitor);
450 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); 449 v8::V8::VisitHandlesWithClassIds(isolate, &tracer);
451 } 450 }
452 451
453 } // namespace blink 452 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/ScriptForbiddenScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698