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

Side by Side Diff: third_party/WebKit/Source/core/dom/PendingScript.h

Issue 2706243006: Check that PendingScript::m_streamer is always null when resource() is null (Closed)
Patch Set: Do not checkState() when dispose() -- it might be already disposed(). Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void dispose(); 107 void dispose();
108 108
109 private: 109 private:
110 PendingScript(Element*, 110 PendingScript(Element*,
111 ScriptResource*, 111 ScriptResource*,
112 const TextPosition&, 112 const TextPosition&,
113 bool isForTesting = false); 113 bool isForTesting = false);
114 PendingScript() = delete; 114 PendingScript() = delete;
115 115
116 void checkState() const;
117
116 // ScriptResourceClient 118 // ScriptResourceClient
117 void notifyFinished(Resource*) override; 119 void notifyFinished(Resource*) override;
118 String debugName() const override { return "PendingScript"; } 120 String debugName() const override { return "PendingScript"; }
119 void notifyAppendData(ScriptResource*) override; 121 void notifyAppendData(ScriptResource*) override;
120 122
121 // MemoryCoordinatorClient 123 // MemoryCoordinatorClient
122 void onPurgeMemory() override; 124 void onPurgeMemory() override;
123 125
124 bool m_watchingForLoad; 126 bool m_watchingForLoad;
125 127
126 // |m_element| must points to the corresponding ScriptLoader's element and 128 // |m_element| must points to the corresponding ScriptLoader's element and
127 // thus must be non-null before dispose() is called (except for unit tests). 129 // thus must be non-null before dispose() is called (except for unit tests).
128 Member<Element> m_element; 130 Member<Element> m_element;
129 131
130 TextPosition m_startingPosition; // Only used for inline script tags. 132 TextPosition m_startingPosition; // Only used for inline script tags.
131 bool m_integrityFailure; 133 bool m_integrityFailure;
132 double m_parserBlockingLoadStartTime; 134 double m_parserBlockingLoadStartTime;
133 135
134 Member<ScriptStreamer> m_streamer; 136 Member<ScriptStreamer> m_streamer;
135 Member<PendingScriptClient> m_client; 137 Member<PendingScriptClient> m_client;
136 138
137 // This flag is used to skip non-null checks of |m_element| in unit tests, 139 // This flag is used to skip non-null checks of |m_element| in unit tests,
138 // because |m_element| can be null in unit tests. 140 // because |m_element| can be null in unit tests.
139 const bool m_isForTesting; 141 const bool m_isForTesting;
140 }; 142 };
141 143
142 } // namespace blink 144 } // namespace blink
143 145
144 #endif // PendingScript_h 146 #endif // PendingScript_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698