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

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

Issue 707213002: bindings: Explicitly passes a v8::Isolate to DOMDataStore. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 1 month 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
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // the DOM objects are not collected forever. (Note that 450 // the DOM objects are not collected forever. (Note that
451 // Oilpan's GC is not triggered unless Oilpan's heap gets full.) 451 // Oilpan's GC is not triggered unless Oilpan's heap gets full.)
452 // (6) V8 hits OOM. 452 // (6) V8 hits OOM.
453 ThreadState::current()->setGCRequested(); 453 ThreadState::current()->setGCRequested();
454 } 454 }
455 } 455 }
456 456
457 void V8GCController::collectGarbage(v8::Isolate* isolate) 457 void V8GCController::collectGarbage(v8::Isolate* isolate)
458 { 458 {
459 v8::HandleScope handleScope(isolate); 459 v8::HandleScope handleScope(isolate);
460 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create()); 460 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create(isolate));
461 ScriptState::Scope scope(scriptState.get()); 461 ScriptState::Scope scope(scriptState.get());
462 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc(); "), isolate); 462 V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc(); "), isolate);
463 scriptState->disposePerContextData(); 463 scriptState->disposePerContextData();
464 } 464 }
465 465
466 void V8GCController::reportDOMMemoryUsageToV8(v8::Isolate* isolate) 466 void V8GCController::reportDOMMemoryUsageToV8(v8::Isolate* isolate)
467 { 467 {
468 if (!isMainThread()) 468 if (!isMainThread())
469 return; 469 return;
470 470
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 Visitor* m_visitor; 502 Visitor* m_visitor;
503 }; 503 };
504 504
505 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) 505 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor)
506 { 506 {
507 DOMWrapperTracer tracer(visitor); 507 DOMWrapperTracer tracer(visitor);
508 v8::V8::VisitHandlesWithClassIds(isolate, &tracer); 508 v8::V8::VisitHandlesWithClassIds(isolate, &tracer);
509 } 509 }
510 510
511 } // namespace blink 511 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptPromisePropertyTest.cpp ('k') | Source/bindings/core/v8/V8PerIsolateData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698