Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Side by Side Diff: Source/web/WebLeakDetector.cpp

Issue 413993002: LeakDetector: Terminate all WebEmbeddedWorkerImpl before counting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rename set Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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();
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
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
OLDNEW
« Source/web/WebEmbeddedWorkerImpl.h ('K') | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698