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

Unified Diff: Source/core/dom/ScriptLoader.h

Issue 660233002: Oilpan: move ScriptLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No detachment of ScriptLoaders when finalizing ScriptRunner Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/PendingScript.h ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptLoader.h
diff --git a/Source/core/dom/ScriptLoader.h b/Source/core/dom/ScriptLoader.h
index b82a15d0a503cf18244ed81051552237fbe900d3..7353578977e0ba5ac5f0a30f866a61192cb014d6 100644
--- a/Source/core/dom/ScriptLoader.h
+++ b/Source/core/dom/ScriptLoader.h
@@ -36,10 +36,15 @@ class ScriptLoaderClient;
class ScriptSourceCode;
-class ScriptLoader final : private ScriptResourceClient {
+class ScriptLoader final : public NoBaseWillBeGarbageCollectedFinalized<ScriptLoader>, private ScriptResourceClient {
public:
- static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool isEvaluated);
+ static PassOwnPtrWillBeRawPtr<ScriptLoader> create(Element* element, bool createdByParser, bool isEvaluated)
+ {
+ return adoptPtrWillBeNoop(new ScriptLoader(element, createdByParser, isEvaluated));
+ }
+
virtual ~ScriptLoader();
+ virtual void trace(Visitor*);
Element* element() const { return m_element; }
@@ -91,10 +96,14 @@ private:
// ResourceClient
virtual void notifyFinished(Resource*) override;
- // FIXME: Oilpan: This should become a Member once ResourceClient is moved to the heap.
- Element* m_element;
+ RawPtrWillBeMember<Element> m_element;
ResourcePtr<ScriptResource> m_resource;
WTF::OrdinalNumber m_startLineNumber;
+ String m_characterEncoding;
+ String m_fallbackCharacterEncoding;
+
+ PendingScript m_pendingScript;
+
bool m_parserInserted : 1;
bool m_isExternalScript : 1;
bool m_alreadyStarted : 1;
@@ -104,20 +113,10 @@ private:
bool m_willExecuteWhenDocumentFinishedParsing : 1;
bool m_forceAsync : 1;
bool m_willExecuteInOrder : 1;
- String m_characterEncoding;
- String m_fallbackCharacterEncoding;
-
- PendingScript m_pendingScript;
};
ScriptLoader* toScriptLoaderIfPossible(Element*);
-inline PassOwnPtr<ScriptLoader> ScriptLoader::create(Element* element, bool createdByParser, bool isEvaluated)
-{
- return adoptPtr(new ScriptLoader(element, createdByParser, isEvaluated));
-}
-
-}
-
+} // namespace blink
-#endif
+#endif // ScriptLoader_h
« no previous file with comments | « Source/core/dom/PendingScript.h ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698