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 23 matching lines...) Expand all Loading... | |
34 | 34 |
35 #include "bindings/core/v8/V8Binding.h" | 35 #include "bindings/core/v8/V8Binding.h" |
36 #include "bindings/core/v8/V8GCController.h" | 36 #include "bindings/core/v8/V8GCController.h" |
37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
38 #include "core/fetch/MemoryCache.h" | 38 #include "core/fetch/MemoryCache.h" |
39 #include "core/fetch/ResourceFetcher.h" | 39 #include "core/fetch/ResourceFetcher.h" |
40 #include "core/inspector/InspectorCounters.h" | 40 #include "core/inspector/InspectorCounters.h" |
41 #include "platform/Timer.h" | 41 #include "platform/Timer.h" |
42 #include "public/web/WebDocument.h" | 42 #include "public/web/WebDocument.h" |
43 #include "public/web/WebLocalFrame.h" | 43 #include "public/web/WebLocalFrame.h" |
44 #include "web/WebEmbeddedWorkerImpl.h" | |
44 | 45 |
45 #include <v8.h> | 46 #include <v8.h> |
46 | 47 |
47 using namespace blink; | 48 using namespace blink; |
48 | 49 |
49 namespace blink { | 50 namespace blink { |
50 | 51 |
51 namespace { | 52 namespace { |
52 | 53 |
53 // 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. |
(...skipping 21 matching lines...) Expand all Loading... | |
75 void delayedReport(Timer<WebLeakDetectorImpl>*); | 76 void delayedReport(Timer<WebLeakDetectorImpl>*); |
76 | 77 |
77 WebLeakDetectorClient* m_client; | 78 WebLeakDetectorClient* m_client; |
78 Timer<WebLeakDetectorImpl> m_delayedGCAndReportTimer; | 79 Timer<WebLeakDetectorImpl> m_delayedGCAndReportTimer; |
79 Timer<WebLeakDetectorImpl> m_delayedReportTimer; | 80 Timer<WebLeakDetectorImpl> m_delayedReportTimer; |
80 int m_numberOfGCNeeded; | 81 int m_numberOfGCNeeded; |
81 }; | 82 }; |
82 | 83 |
83 void WebLeakDetectorImpl::collectGarbageAndGetDOMCounts(WebLocalFrame* frame) | 84 void WebLeakDetectorImpl::collectGarbageAndGetDOMCounts(WebLocalFrame* frame) |
84 { | 85 { |
86 WebEmbeddedWorkerImpl::terminateAll(); | |
michaeln
2014/07/25 00:07:09
i think it will take some time to unwind the backg
kouhei (in TOK)
2014/07/25 01:33:09
LeakDetector already flushes the task queue 2 time
michaeln
2014/07/25 02:49:52
i doubt if the collection of running instances is
kouhei (in TOK)
2014/07/25 05:00:39
Yes I confirmed that there are no false positive l
| |
85 memoryCache()->evictResources(); | 87 memoryCache()->evictResources(); |
86 | 88 |
87 { | 89 { |
88 RefPtrWillBeRawPtr<Document> document = PassRefPtrWillBeRawPtr<Document> (frame->document()); | 90 RefPtrWillBeRawPtr<Document> document = PassRefPtrWillBeRawPtr<Document> (frame->document()); |
89 if (ResourceFetcher* fetcher = document->fetcher()) | 91 if (ResourceFetcher* fetcher = document->fetcher()) |
90 fetcher->garbageCollectDocumentResources(); | 92 fetcher->garbageCollectDocumentResources(); |
91 } | 93 } |
92 | 94 |
93 // FIXME: HTML5 Notification should be closed because notification affects t he result of number of DOM objects. | 95 // FIXME: HTML5 Notification should be closed because notification affects t he result of number of DOM objects. |
94 | 96 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 } | 139 } |
138 | 140 |
139 } // namespace | 141 } // namespace |
140 | 142 |
141 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) | 143 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) |
142 { | 144 { |
143 return new WebLeakDetectorImpl(client); | 145 return new WebLeakDetectorImpl(client); |
144 } | 146 } |
145 | 147 |
146 } // namespace blink | 148 } // namespace blink |
OLD | NEW |