| 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 #ifndef WebLeakDetector_h | 31 #ifndef WebLeakDetector_h |
| 32 #define WebLeakDetector_h | 32 #define WebLeakDetector_h |
| 33 | 33 |
| 34 #include "WebFrame.h" | |
| 35 #include "public/platform/WebCommon.h" | 34 #include "public/platform/WebCommon.h" |
| 36 | 35 |
| 37 namespace blink { | 36 namespace blink { |
| 38 | 37 |
| 38 class WebFrame; |
| 39 |
| 39 class WebLeakDetectorClient { | 40 class WebLeakDetectorClient { |
| 40 public: | 41 public: |
| 41 struct Result { | 42 struct Result { |
| 42 unsigned numberOfLiveAudioNodes; | 43 unsigned numberOfLiveAudioNodes; |
| 43 unsigned numberOfLiveDocuments; | 44 unsigned numberOfLiveDocuments; |
| 44 unsigned numberOfLiveNodes; | 45 unsigned numberOfLiveNodes; |
| 45 unsigned numberOfLiveLayoutObjects; | 46 unsigned numberOfLiveLayoutObjects; |
| 46 unsigned numberOfLiveResources; | 47 unsigned numberOfLiveResources; |
| 47 unsigned numberOfLiveActiveDOMObjects; | 48 unsigned numberOfLiveActiveDOMObjects; |
| 48 unsigned numberOfLiveScriptPromises; | 49 unsigned numberOfLiveScriptPromises; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 // | 73 // |
| 73 // |WebLeakDetectorClient::onLeakDetectionComplete()| is called | 74 // |WebLeakDetectorClient::onLeakDetectionComplete()| is called |
| 74 // with the result of the (leaked) resource counting. | 75 // with the result of the (leaked) resource counting. |
| 75 // | 76 // |
| 76 // By separating into two, the caller is able to inject any | 77 // By separating into two, the caller is able to inject any |
| 77 // additional releasing of resources needed before the garbage | 78 // additional releasing of resources needed before the garbage |
| 78 // collections go ahead. | 79 // collections go ahead. |
| 79 | 80 |
| 80 // Perform initial stage of preparing for leak detection, | 81 // Perform initial stage of preparing for leak detection, |
| 81 // releasing references to resources held globally. | 82 // releasing references to resources held globally. |
| 82 virtual void prepareForLeakDetection() = 0; | 83 virtual void prepareForLeakDetection(WebFrame*) = 0; |
| 83 | 84 |
| 84 // Garbage collect Blink's heaps and report leak counts. | 85 // Garbage collect Blink's heaps and report leak counts. |
| 85 // |WebLeakDetectorClient::onLeakDetectionComplete()| is called | 86 // |WebLeakDetectorClient::onLeakDetectionComplete()| is called |
| 86 // upon completion. | 87 // upon completion. |
| 87 virtual void collectGarbageAndReport() = 0; | 88 virtual void collectGarbageAndReport() = 0; |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace blink | 91 } // namespace blink |
| 91 | 92 |
| 92 #endif // WebLeakDetector_h | 93 #endif // WebLeakDetector_h |
| OLD | NEW |