| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 441 } |
| 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 = |
| 452 v8::Context::New(isolate), DOMWrapperWorld::create(isolate)); | 452 ScriptState::create(v8::Context::New(isolate), |
| 453 DOMWrapperWorld::create(isolate, 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 Loading... |
| 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 |
| OLD | NEW |