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

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

Issue 2690943002: Revert of binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: Created 3 years, 10 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 461 }
462 462
463 void V8GCController::collectAllGarbageForTesting(v8::Isolate* isolate) { 463 void V8GCController::collectAllGarbageForTesting(v8::Isolate* isolate) {
464 for (unsigned i = 0; i < 5; i++) 464 for (unsigned i = 0; i < 5; i++)
465 isolate->RequestGarbageCollectionForTesting( 465 isolate->RequestGarbageCollectionForTesting(
466 v8::Isolate::kFullGarbageCollection); 466 v8::Isolate::kFullGarbageCollection);
467 } 467 }
468 468
469 class DOMWrapperTracer : public v8::PersistentHandleVisitor { 469 class DOMWrapperTracer : public v8::PersistentHandleVisitor {
470 public: 470 public:
471 explicit DOMWrapperTracer(Visitor* visitor) : m_visitor(visitor) { 471 explicit DOMWrapperTracer(Visitor* visitor) : m_visitor(visitor) {}
472 DCHECK(m_visitor);
473 }
474 472
475 void VisitPersistentHandle(v8::Persistent<v8::Value>* value, 473 void VisitPersistentHandle(v8::Persistent<v8::Value>* value,
476 uint16_t classId) override { 474 uint16_t classId) override {
477 if (classId != WrapperTypeInfo::NodeClassId && 475 if (classId != WrapperTypeInfo::NodeClassId &&
478 classId != WrapperTypeInfo::ObjectClassId) 476 classId != WrapperTypeInfo::ObjectClassId)
479 return; 477 return;
480 478
481 const v8::Persistent<v8::Object>& wrapper = 479 const v8::Persistent<v8::Object>& wrapper =
482 v8::Persistent<v8::Object>::Cast(*value); 480 v8::Persistent<v8::Object>::Cast(*value);
483 481
484 if (ScriptWrappable* scriptWrappable = toScriptWrappable(wrapper)) 482 if (m_visitor)
485 toWrapperTypeInfo(wrapper)->trace(m_visitor, scriptWrappable); 483 toWrapperTypeInfo(wrapper)->trace(m_visitor, toScriptWrappable(wrapper));
486 } 484 }
487 485
488 private: 486 private:
489 Visitor* m_visitor; 487 Visitor* m_visitor;
490 }; 488 };
491 489
492 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) { 490 void V8GCController::traceDOMWrappers(v8::Isolate* isolate, Visitor* visitor) {
493 DOMWrapperTracer tracer(visitor); 491 DOMWrapperTracer tracer(visitor);
494 isolate->VisitHandlesWithClassIds(&tracer); 492 isolate->VisitHandlesWithClassIds(&tracer);
495 } 493 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 double startTime = WTF::currentTimeMS(); 547 double startTime = WTF::currentTimeMS();
550 v8::HandleScope scope(isolate); 548 v8::HandleScope scope(isolate);
551 PendingActivityVisitor visitor(isolate, executionContext); 549 PendingActivityVisitor visitor(isolate, executionContext);
552 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); 550 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor);
553 scanPendingActivityHistogram.count( 551 scanPendingActivityHistogram.count(
554 static_cast<int>(WTF::currentTimeMS() - startTime)); 552 static_cast<int>(WTF::currentTimeMS() - startTime));
555 return visitor.pendingActivityFound(); 553 return visitor.pendingActivityFound();
556 } 554 }
557 555
558 } // namespace blink 556 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h ('k') | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698