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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 26792002: Reland: Reland: Implement new Blink IDL attribute [SetReference] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (!page->mainFrame()->spellChecker().isContinuousSpellCheckingEnabled()) 203 if (!page->mainFrame()->spellChecker().isContinuousSpellCheckingEnabled())
204 page->mainFrame()->spellChecker().toggleContinuousSpellChecking(); 204 page->mainFrame()->spellChecker().toggleContinuousSpellChecking();
205 if (page->mainFrame()->editor().isOverwriteModeEnabled()) 205 if (page->mainFrame()->editor().isOverwriteModeEnabled())
206 page->mainFrame()->editor().toggleOverwriteModeEnabled(); 206 page->mainFrame()->editor().toggleOverwriteModeEnabled();
207 } 207 }
208 208
209 Internals::Internals(Document* document) 209 Internals::Internals(Document* document)
210 : ContextLifecycleObserver(document) 210 : ContextLifecycleObserver(document)
211 , m_runtimeFlags(InternalRuntimeFlags::create()) 211 , m_runtimeFlags(InternalRuntimeFlags::create())
212 , m_scrollingCoordinator(document->page() ? document->page()->scrollingCoord inator() : 0) 212 , m_scrollingCoordinator(document->page() ? document->page()->scrollingCoord inator() : 0)
213 , m_gcWithoutContextTimer(this, &Internals::garbageCollectV8WithoutContextTi merFired)
213 { 214 {
214 } 215 }
215 216
216 Document* Internals::contextDocument() const 217 Document* Internals::contextDocument() const
217 { 218 {
218 return toDocument(executionContext()); 219 return toDocument(executionContext());
219 } 220 }
220 221
221 Frame* Internals::frame() const 222 Frame* Internals::frame() const
222 { 223 {
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 if (!sharedContext) 2273 if (!sharedContext)
2273 return false; 2274 return false;
2274 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2275 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2275 // To prevent tests that call loseSharedGraphicsContext3D from being 2276 // To prevent tests that call loseSharedGraphicsContext3D from being
2276 // flaky, we call finish so that the context is guaranteed to be lost 2277 // flaky, we call finish so that the context is guaranteed to be lost
2277 // synchronously (i.e. before returning). 2278 // synchronously (i.e. before returning).
2278 sharedContext->finish(); 2279 sharedContext->finish();
2279 return true; 2280 return true;
2280 } 2281 }
2281 2282
2283 void Internals::garbageCollectV8WithoutContext()
2284 {
2285 m_gcWithoutContextTimer.startOneShot(0);
2282 } 2286 }
2287
2288 void Internals::garbageCollectV8WithoutContextTimerFired(Timer<Internals>*)
2289 {
2290 const int largeEnoughValueToTriggerMajorGC = 10000;
2291 for (int i = 0; i < 100; ++i)
2292 v8::V8::IdleNotification(largeEnoughValueToTriggerMajorGC);
haraken 2013/10/25 08:54:12 This looks fragile. Probably you can use V8GCContr
2293 }
2294
2295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698