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

Side by Side Diff: Source/bindings/v8/V8GCForContextDispose.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/accessibility/AXObjectCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 28 matching lines...) Expand all
39 : m_pseudoIdleTimer(this, &V8GCForContextDispose::pseudoIdleTimerFired) 39 : m_pseudoIdleTimer(this, &V8GCForContextDispose::pseudoIdleTimerFired)
40 , m_didDisposeContextForMainFrame(false) 40 , m_didDisposeContextForMainFrame(false)
41 { 41 {
42 } 42 }
43 43
44 void V8GCForContextDispose::notifyContextDisposed(bool isMainFrame) 44 void V8GCForContextDispose::notifyContextDisposed(bool isMainFrame)
45 { 45 {
46 m_didDisposeContextForMainFrame = m_didDisposeContextForMainFrame || isMainF rame; 46 m_didDisposeContextForMainFrame = m_didDisposeContextForMainFrame || isMainF rame;
47 v8::V8::ContextDisposedNotification(); 47 v8::V8::ContextDisposedNotification();
48 if (!m_pseudoIdleTimer.isActive()) 48 if (!m_pseudoIdleTimer.isActive())
49 m_pseudoIdleTimer.startOneShot(0.8); 49 m_pseudoIdleTimer.startOneShot(0.8, FROM_HERE);
50 } 50 }
51 51
52 void V8GCForContextDispose::notifyIdleSooner(double maximumFireInterval) 52 void V8GCForContextDispose::notifyIdleSooner(double maximumFireInterval)
53 { 53 {
54 if (m_pseudoIdleTimer.isActive()) { 54 if (m_pseudoIdleTimer.isActive()) {
55 double nextFireInterval = m_pseudoIdleTimer.nextFireInterval(); 55 double nextFireInterval = m_pseudoIdleTimer.nextFireInterval();
56 if (nextFireInterval > maximumFireInterval) { 56 if (nextFireInterval > maximumFireInterval) {
57 m_pseudoIdleTimer.stop(); 57 m_pseudoIdleTimer.stop();
58 m_pseudoIdleTimer.startOneShot(maximumFireInterval); 58 m_pseudoIdleTimer.startOneShot(maximumFireInterval, FROM_HERE);
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 V8GCForContextDispose& V8GCForContextDispose::instanceTemplate() 63 V8GCForContextDispose& V8GCForContextDispose::instanceTemplate()
64 { 64 {
65 DEFINE_STATIC_LOCAL(V8GCForContextDispose, staticInstance, ()); 65 DEFINE_STATIC_LOCAL(V8GCForContextDispose, staticInstance, ());
66 return staticInstance; 66 return staticInstance;
67 } 67 }
68 68
69 void V8GCForContextDispose::pseudoIdleTimerFired(Timer<V8GCForContextDispose>*) 69 void V8GCForContextDispose::pseudoIdleTimerFired(Timer<V8GCForContextDispose>*)
70 { 70 {
71 const int longIdlePauseInMs = 1000; 71 const int longIdlePauseInMs = 1000;
72 const int shortIdlePauseInMs = 10; 72 const int shortIdlePauseInMs = 10;
73 int hint = m_didDisposeContextForMainFrame ? longIdlePauseInMs : shortIdlePa useInMs; 73 int hint = m_didDisposeContextForMainFrame ? longIdlePauseInMs : shortIdlePa useInMs;
74 v8::V8::IdleNotification(hint); 74 v8::V8::IdleNotification(hint);
75 m_didDisposeContextForMainFrame = false; 75 m_didDisposeContextForMainFrame = false;
76 } 76 }
77 77
78 } // namespace WebCore 78 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/accessibility/AXObjectCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698