OLD | NEW |
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 Loading... |
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, |
| 454 DOMWrapperWorld::WorldType::GarbageCollector)); |
453 ScriptState::Scope scope(scriptState.get()); | 455 ScriptState::Scope scope(scriptState.get()); |
454 StringBuilder builder; | 456 StringBuilder builder; |
455 builder.append("if (gc) gc("); | 457 builder.append("if (gc) gc("); |
456 builder.append(onlyMinorGC ? "true" : "false"); | 458 builder.append(onlyMinorGC ? "true" : "false"); |
457 builder.append(")"); | 459 builder.append(")"); |
458 V8ScriptRunner::compileAndRunInternalScript( | 460 V8ScriptRunner::compileAndRunInternalScript( |
459 v8String(isolate, builder.toString()), isolate); | 461 v8String(isolate, builder.toString()), isolate); |
460 scriptState->disposePerContextData(); | 462 scriptState->disposePerContextData(); |
461 } | 463 } |
462 | 464 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 double startTime = WTF::currentTimeMS(); | 549 double startTime = WTF::currentTimeMS(); |
548 v8::HandleScope scope(isolate); | 550 v8::HandleScope scope(isolate); |
549 PendingActivityVisitor visitor(isolate, executionContext); | 551 PendingActivityVisitor visitor(isolate, executionContext); |
550 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); | 552 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); |
551 scanPendingActivityHistogram.count( | 553 scanPendingActivityHistogram.count( |
552 static_cast<int>(WTF::currentTimeMS() - startTime)); | 554 static_cast<int>(WTF::currentTimeMS() - startTime)); |
553 return visitor.pendingActivityFound(); | 555 return visitor.pendingActivityFound(); |
554 } | 556 } |
555 | 557 |
556 } // namespace blink | 558 } // namespace blink |
OLD | NEW |