OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 V8GCController::collectAllGarbageForTesting(isolate); | 103 V8GCController::collectAllGarbageForTesting(isolate); |
104 // Note: Oilpan precise GC is scheduled at the end of the event loop. | 104 // Note: Oilpan precise GC is scheduled at the end of the event loop. |
105 | 105 |
106 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); | 106 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); |
107 | 107 |
108 // Task queue may contain delayed object destruction tasks. | 108 // Task queue may contain delayed object destruction tasks. |
109 // This method is called from navigation hook inside FrameLoader, | 109 // This method is called from navigation hook inside FrameLoader, |
110 // so previous document is still held by the loader until the next event loo
p. | 110 // so previous document is still held by the loader until the next event loo
p. |
111 // Complete all pending tasks before proceeding to gc. | 111 // Complete all pending tasks before proceeding to gc. |
112 m_numberOfGCNeeded = 2; | 112 m_numberOfGCNeeded = 2; |
113 m_delayedGCAndReportTimer.startOneShot(0, FROM_HERE); | 113 m_delayedGCAndReportTimer.startOneShot(0, BLINK_FROM_HERE); |
114 } | 114 } |
115 | 115 |
116 void WebLeakDetectorImpl::delayedGCAndReport(Timer<WebLeakDetectorImpl>*) | 116 void WebLeakDetectorImpl::delayedGCAndReport(Timer<WebLeakDetectorImpl>*) |
117 { | 117 { |
118 // We do a second and third GC here to address flakiness | 118 // We do a second and third GC here to address flakiness |
119 // The second GC is necessary as Resource GC may have postponed clean-up tas
ks to next event loop. | 119 // The second GC is necessary as Resource GC may have postponed clean-up tas
ks to next event loop. |
120 // The third GC is necessary for cleaning up Document after worker object di
ed. | 120 // The third GC is necessary for cleaning up Document after worker object di
ed. |
121 | 121 |
122 V8GCController::collectAllGarbageForTesting(V8PerIsolateData::mainThreadIsol
ate()); | 122 V8GCController::collectAllGarbageForTesting(V8PerIsolateData::mainThreadIsol
ate()); |
123 // Note: Oilpan precise GC is scheduled at the end of the event loop. | 123 // Note: Oilpan precise GC is scheduled at the end of the event loop. |
124 | 124 |
125 // Inspect counters on the next event loop. | 125 // Inspect counters on the next event loop. |
126 if (--m_numberOfGCNeeded) | 126 if (--m_numberOfGCNeeded) |
127 m_delayedGCAndReportTimer.startOneShot(0, FROM_HERE); | 127 m_delayedGCAndReportTimer.startOneShot(0, BLINK_FROM_HERE); |
128 else | 128 else |
129 m_delayedReportTimer.startOneShot(0, FROM_HERE); | 129 m_delayedReportTimer.startOneShot(0, BLINK_FROM_HERE); |
130 } | 130 } |
131 | 131 |
132 void WebLeakDetectorImpl::delayedReport(Timer<WebLeakDetectorImpl>*) | 132 void WebLeakDetectorImpl::delayedReport(Timer<WebLeakDetectorImpl>*) |
133 { | 133 { |
134 ASSERT(m_client); | 134 ASSERT(m_client); |
135 | 135 |
136 WebLeakDetectorClient::Result result; | 136 WebLeakDetectorClient::Result result; |
137 result.numberOfLiveAudioNodes = InstanceCounters::counterValue(InstanceCount
ers::AudioHandlerCounter); | 137 result.numberOfLiveAudioNodes = InstanceCounters::counterValue(InstanceCount
ers::AudioHandlerCounter); |
138 result.numberOfLiveDocuments = InstanceCounters::counterValue(InstanceCounte
rs::DocumentCounter); | 138 result.numberOfLiveDocuments = InstanceCounters::counterValue(InstanceCounte
rs::DocumentCounter); |
139 result.numberOfLiveNodes = InstanceCounters::counterValue(InstanceCounters::
NodeCounter); | 139 result.numberOfLiveNodes = InstanceCounters::counterValue(InstanceCounters::
NodeCounter); |
(...skipping 12 matching lines...) Expand all Loading... |
152 } | 152 } |
153 | 153 |
154 } // namespace | 154 } // namespace |
155 | 155 |
156 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) | 156 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) |
157 { | 157 { |
158 return new WebLeakDetectorImpl(client); | 158 return new WebLeakDetectorImpl(client); |
159 } | 159 } |
160 | 160 |
161 } // namespace blink | 161 } // namespace blink |
OLD | NEW |