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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "public/web/WebLeakDetector.h" | 31 #include "public/web/WebLeakDetector.h" |
32 | 32 |
33 #include "bindings/core/v8/V8GCController.h" | 33 #include "bindings/core/v8/V8GCController.h" |
| 34 #include "core/editing/spellcheck/IdleSpellCheckCallback.h" |
34 #include "core/editing/spellcheck/SpellChecker.h" | 35 #include "core/editing/spellcheck/SpellChecker.h" |
35 #include "core/fetch/MemoryCache.h" | 36 #include "core/fetch/MemoryCache.h" |
36 #include "core/workers/InProcessWorkerMessagingProxy.h" | 37 #include "core/workers/InProcessWorkerMessagingProxy.h" |
37 #include "core/workers/WorkerThread.h" | 38 #include "core/workers/WorkerThread.h" |
38 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" | 39 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" |
39 #include "platform/InstanceCounters.h" | 40 #include "platform/InstanceCounters.h" |
40 #include "platform/Timer.h" | 41 #include "platform/Timer.h" |
41 #include "public/web/WebFrame.h" | 42 #include "public/web/WebFrame.h" |
42 #include "web/WebLocalFrameImpl.h" | 43 #include "web/WebLocalFrameImpl.h" |
43 | 44 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 WorkerThread::terminateAndWaitForAllWorkers(); | 88 WorkerThread::terminateAndWaitForAllWorkers(); |
88 memoryCache()->evictResources(); | 89 memoryCache()->evictResources(); |
89 | 90 |
90 // If the spellchecker is allowed to continue issuing requests while the | 91 // If the spellchecker is allowed to continue issuing requests while the |
91 // leak detector runs, leaks may flakily be reported as the requests keep | 92 // leak detector runs, leaks may flakily be reported as the requests keep |
92 // their associated element (and document) alive. | 93 // their associated element (and document) alive. |
93 // | 94 // |
94 // Stop the spellchecker to prevent this. | 95 // Stop the spellchecker to prevent this. |
95 if (frame->isWebLocalFrame()) { | 96 if (frame->isWebLocalFrame()) { |
96 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame); | 97 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame); |
97 SpellChecker& spellChecker = localFrame->frame()->spellChecker(); | 98 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) |
98 spellChecker.prepareForLeakDetection(); | 99 localFrame->frame()->idleSpellCheckCallback().prepareForLeakDetection(); |
| 100 else |
| 101 localFrame->frame()->spellChecker().prepareForLeakDetection(); |
99 } | 102 } |
100 | 103 |
101 // FIXME: HTML5 Notification should be closed because notification affects the | 104 // FIXME: HTML5 Notification should be closed because notification affects the |
102 // result of number of DOM objects. | 105 // result of number of DOM objects. |
103 | 106 |
104 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); | 107 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); |
105 } | 108 } |
106 | 109 |
107 void WebLeakDetectorImpl::collectGarbageAndReport() { | 110 void WebLeakDetectorImpl::collectGarbageAndReport() { |
108 V8GCController::collectAllGarbageForTesting( | 111 V8GCController::collectAllGarbageForTesting( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 #endif | 183 #endif |
181 } | 184 } |
182 | 185 |
183 } // namespace | 186 } // namespace |
184 | 187 |
185 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) { | 188 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) { |
186 return new WebLeakDetectorImpl(client); | 189 return new WebLeakDetectorImpl(client); |
187 } | 190 } |
188 | 191 |
189 } // namespace blink | 192 } // namespace blink |
OLD | NEW |