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

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

Issue 2735973006: Bindings: Separate WorldIdConstants into WorldTypes and WorldId (Closed)
Patch Set: address review comments Created 3 years, 9 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
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 442 }
443 443
444 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), 444 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
445 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", 445 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
446 InspectorUpdateCountersEvent::data()); 446 InspectorUpdateCountersEvent::data());
447 } 447 }
448 448
449 void V8GCController::collectGarbage(v8::Isolate* isolate, bool onlyMinorGC) { 449 void V8GCController::collectGarbage(v8::Isolate* isolate, bool onlyMinorGC) {
450 v8::HandleScope handleScope(isolate); 450 v8::HandleScope handleScope(isolate);
451 RefPtr<ScriptState> scriptState = ScriptState::create( 451 RefPtr<ScriptState> scriptState = ScriptState::create(
452 v8::Context::New(isolate), DOMWrapperWorld::create(isolate)); 452 v8::Context::New(isolate),
453 DOMWrapperWorld::create(isolate, DOMWrapperWorld::WorldType::Unknown));
453 ScriptState::Scope scope(scriptState.get()); 454 ScriptState::Scope scope(scriptState.get());
454 StringBuilder builder; 455 StringBuilder builder;
455 builder.append("if (gc) gc("); 456 builder.append("if (gc) gc(");
456 builder.append(onlyMinorGC ? "true" : "false"); 457 builder.append(onlyMinorGC ? "true" : "false");
457 builder.append(")"); 458 builder.append(")");
458 V8ScriptRunner::compileAndRunInternalScript( 459 V8ScriptRunner::compileAndRunInternalScript(
459 v8String(isolate, builder.toString()), isolate); 460 v8String(isolate, builder.toString()), isolate);
460 scriptState->disposePerContextData(); 461 scriptState->disposePerContextData();
461 } 462 }
462 463
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 double startTime = WTF::currentTimeMS(); 548 double startTime = WTF::currentTimeMS();
548 v8::HandleScope scope(isolate); 549 v8::HandleScope scope(isolate);
549 PendingActivityVisitor visitor(isolate, executionContext); 550 PendingActivityVisitor visitor(isolate, executionContext);
550 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); 551 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor);
551 scanPendingActivityHistogram.count( 552 scanPendingActivityHistogram.count(
552 static_cast<int>(WTF::currentTimeMS() - startTime)); 553 static_cast<int>(WTF::currentTimeMS() - startTime));
553 return visitor.pendingActivityFound(); 554 return visitor.pendingActivityFound();
554 } 555 }
555 556
556 } // namespace blink 557 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698