| 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" | |
| 35 #include "core/editing/spellcheck/SpellChecker.h" | 34 #include "core/editing/spellcheck/SpellChecker.h" |
| 36 #include "core/workers/InProcessWorkerMessagingProxy.h" | 35 #include "core/workers/InProcessWorkerMessagingProxy.h" |
| 37 #include "core/workers/WorkerThread.h" | 36 #include "core/workers/WorkerThread.h" |
| 38 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" | 37 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" |
| 39 #include "platform/InstanceCounters.h" | 38 #include "platform/InstanceCounters.h" |
| 40 #include "platform/Timer.h" | 39 #include "platform/Timer.h" |
| 41 #include "platform/loader/fetch/MemoryCache.h" | 40 #include "platform/loader/fetch/MemoryCache.h" |
| 42 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 43 #include "public/platform/WebThread.h" | 42 #include "public/platform/WebThread.h" |
| 44 #include "public/web/WebFrame.h" | 43 #include "public/web/WebFrame.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 WorkerThread::terminateAndWaitForAllWorkers(); | 94 WorkerThread::terminateAndWaitForAllWorkers(); |
| 96 memoryCache()->evictResources(); | 95 memoryCache()->evictResources(); |
| 97 | 96 |
| 98 // If the spellchecker is allowed to continue issuing requests while the | 97 // If the spellchecker is allowed to continue issuing requests while the |
| 99 // leak detector runs, leaks may flakily be reported as the requests keep | 98 // leak detector runs, leaks may flakily be reported as the requests keep |
| 100 // their associated element (and document) alive. | 99 // their associated element (and document) alive. |
| 101 // | 100 // |
| 102 // Stop the spellchecker to prevent this. | 101 // Stop the spellchecker to prevent this. |
| 103 if (frame->isWebLocalFrame()) { | 102 if (frame->isWebLocalFrame()) { |
| 104 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame); | 103 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame); |
| 105 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) | 104 localFrame->frame()->spellChecker().prepareForLeakDetection(); |
| 106 localFrame->frame()->idleSpellCheckCallback().prepareForLeakDetection(); | |
| 107 else | |
| 108 localFrame->frame()->spellChecker().prepareForLeakDetection(); | |
| 109 } | 105 } |
| 110 | 106 |
| 111 // FIXME: HTML5 Notification should be closed because notification affects the | 107 // FIXME: HTML5 Notification should be closed because notification affects the |
| 112 // result of number of DOM objects. | 108 // result of number of DOM objects. |
| 113 | 109 |
| 114 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); | 110 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); |
| 115 } | 111 } |
| 116 | 112 |
| 117 void WebLeakDetectorImpl::collectGarbageAndReport() { | 113 void WebLeakDetectorImpl::collectGarbageAndReport() { |
| 118 V8GCController::collectAllGarbageForTesting( | 114 V8GCController::collectAllGarbageForTesting( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 #endif | 186 #endif |
| 191 } | 187 } |
| 192 | 188 |
| 193 } // namespace | 189 } // namespace |
| 194 | 190 |
| 195 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) { | 191 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) { |
| 196 return new WebLeakDetectorImpl(client); | 192 return new WebLeakDetectorImpl(client); |
| 197 } | 193 } |
| 198 | 194 |
| 199 } // namespace blink | 195 } // namespace blink |
| OLD | NEW |