| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include <v8.h> | 48 #include <v8.h> |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 // FIXME: Oilpan: It may take multiple GC to collect on-heap objects referenced
from off-heap objects. | 54 // FIXME: Oilpan: It may take multiple GC to collect on-heap objects referenced
from off-heap objects. |
| 55 // Please see comment in Heap::collectAllGarbage() | 55 // Please see comment in Heap::collectAllGarbage() |
| 56 static const int kNumberOfGCsToClaimChains = 5; | 56 static const int kNumberOfGCsToClaimChains = 5; |
| 57 | 57 |
| 58 class WebLeakDetectorImpl FINAL : public WebLeakDetector { | 58 class WebLeakDetectorImpl final : public WebLeakDetector { |
| 59 WTF_MAKE_NONCOPYABLE(WebLeakDetectorImpl); | 59 WTF_MAKE_NONCOPYABLE(WebLeakDetectorImpl); |
| 60 public: | 60 public: |
| 61 explicit WebLeakDetectorImpl(WebLeakDetectorClient* client) | 61 explicit WebLeakDetectorImpl(WebLeakDetectorClient* client) |
| 62 : m_client(client) | 62 : m_client(client) |
| 63 , m_delayedGCAndReportTimer(this, &WebLeakDetectorImpl::delayedGCAndRepo
rt) | 63 , m_delayedGCAndReportTimer(this, &WebLeakDetectorImpl::delayedGCAndRepo
rt) |
| 64 , m_delayedReportTimer(this, &WebLeakDetectorImpl::delayedReport) | 64 , m_delayedReportTimer(this, &WebLeakDetectorImpl::delayedReport) |
| 65 , m_numberOfGCNeeded(0) | 65 , m_numberOfGCNeeded(0) |
| 66 { | 66 { |
| 67 ASSERT(m_client); | 67 ASSERT(m_client); |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual ~WebLeakDetectorImpl() { } | 70 virtual ~WebLeakDetectorImpl() { } |
| 71 | 71 |
| 72 virtual void collectGarbageAndGetDOMCounts(WebLocalFrame*) OVERRIDE; | 72 virtual void collectGarbageAndGetDOMCounts(WebLocalFrame*) override; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 void delayedGCAndReport(Timer<WebLeakDetectorImpl>*); | 75 void delayedGCAndReport(Timer<WebLeakDetectorImpl>*); |
| 76 void delayedReport(Timer<WebLeakDetectorImpl>*); | 76 void delayedReport(Timer<WebLeakDetectorImpl>*); |
| 77 | 77 |
| 78 WebLeakDetectorClient* m_client; | 78 WebLeakDetectorClient* m_client; |
| 79 Timer<WebLeakDetectorImpl> m_delayedGCAndReportTimer; | 79 Timer<WebLeakDetectorImpl> m_delayedGCAndReportTimer; |
| 80 Timer<WebLeakDetectorImpl> m_delayedReportTimer; | 80 Timer<WebLeakDetectorImpl> m_delayedReportTimer; |
| 81 int m_numberOfGCNeeded; | 81 int m_numberOfGCNeeded; |
| 82 }; | 82 }; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) | 146 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) |
| 147 { | 147 { |
| 148 return new WebLeakDetectorImpl(client); | 148 return new WebLeakDetectorImpl(client); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |