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

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

Issue 1428383002: Make ResourceFetcher::m_documentResources use WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODOs Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 32
33 #include "public/web/WebLeakDetector.h" 33 #include "public/web/WebLeakDetector.h"
34 34
35 #include "bindings/core/v8/ScriptPromise.h" 35 #include "bindings/core/v8/ScriptPromise.h"
36 #include "bindings/core/v8/V8Binding.h" 36 #include "bindings/core/v8/V8Binding.h"
37 #include "bindings/core/v8/V8GCController.h" 37 #include "bindings/core/v8/V8GCController.h"
38 #include "core/dom/ActiveDOMObject.h" 38 #include "core/dom/ActiveDOMObject.h"
39 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
40 #include "core/fetch/MemoryCache.h" 40 #include "core/fetch/MemoryCache.h"
41 #include "core/fetch/ResourceFetcher.h"
42 #include "core/inspector/InstanceCounters.h" 41 #include "core/inspector/InstanceCounters.h"
43 #include "core/layout/LayoutObject.h" 42 #include "core/layout/LayoutObject.h"
44 #include "core/workers/WorkerThread.h" 43 #include "core/workers/WorkerThread.h"
45 #include "modules/webaudio/AudioNode.h" 44 #include "modules/webaudio/AudioNode.h"
46 #include "platform/Timer.h" 45 #include "platform/Timer.h"
47 #include "public/web/WebDocument.h" 46 #include "public/web/WebDocument.h"
48 #include "public/web/WebLocalFrame.h" 47 #include "public/web/WebLocalFrame.h"
49 48
50 namespace blink { 49 namespace blink {
51 50
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // For example, calling isValidEmailAddress in EmailInputType.cpp with a 85 // For example, calling isValidEmailAddress in EmailInputType.cpp with a
87 // non-empty string creates a static ScriptRegexp value which holds a 86 // non-empty string creates a static ScriptRegexp value which holds a
88 // V8PerContextData indirectly. This affects the number of V8PerContextData. 87 // V8PerContextData indirectly. This affects the number of V8PerContextData.
89 // To ensure that context data is created, call ensureScriptRegexpContext 88 // To ensure that context data is created, call ensureScriptRegexpContext
90 // here. 89 // here.
91 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); 90 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext();
92 91
93 WorkerThread::terminateAndWaitForAllWorkers(); 92 WorkerThread::terminateAndWaitForAllWorkers();
94 memoryCache()->evictResources(); 93 memoryCache()->evictResources();
95 94
96 {
97 RefPtrWillBeRawPtr<Document> document = PassRefPtrWillBeRawPtr<Document> (frame->document());
98 if (ResourceFetcher* fetcher = document->fetcher())
99 fetcher->garbageCollectDocumentResources();
100 }
101
102 // 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.
103 96
104 V8PerIsolateData::from(isolate)->clearScriptRegexpContext(); 97 V8PerIsolateData::from(isolate)->clearScriptRegexpContext();
105 } 98 }
106 99
107 void WebLeakDetectorImpl::collectGarbageAndReport() 100 void WebLeakDetectorImpl::collectGarbageAndReport()
108 { 101 {
109 V8GCController::collectAllGarbageForTesting(V8PerIsolateData::mainThreadIsol ate()); 102 V8GCController::collectAllGarbageForTesting(V8PerIsolateData::mainThreadIsol ate());
110 // Note: Oilpan precise GC is scheduled at the end of the event loop. 103 // Note: Oilpan precise GC is scheduled at the end of the event loop.
111 104
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 149 }
157 150
158 } // namespace 151 } // namespace
159 152
160 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client) 153 WebLeakDetector* WebLeakDetector::create(WebLeakDetectorClient* client)
161 { 154 {
162 return new WebLeakDetectorImpl(client); 155 return new WebLeakDetectorImpl(client);
163 } 156 }
164 157
165 } // namespace blink 158 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698