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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 15 matching lines...) Expand all
26 #include "core/dom/PendingScript.h" 26 #include "core/dom/PendingScript.h"
27 27
28 #include "bindings/core/v8/ScriptSourceCode.h" 28 #include "bindings/core/v8/ScriptSourceCode.h"
29 #include "core/dom/Element.h" 29 #include "core/dom/Element.h"
30 #include "core/fetch/ScriptResource.h" 30 #include "core/fetch/ScriptResource.h"
31 #include "core/frame/SubresourceIntegrity.h" 31 #include "core/frame/SubresourceIntegrity.h"
32 #include "platform/SharedBuffer.h" 32 #include "platform/SharedBuffer.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 PassOwnPtrWillBeRawPtr<PendingScript> PendingScript::create(Element* element, Sc riptResource* resource) 36 RawPtr<PendingScript> PendingScript::create(Element* element, ScriptResource* re source)
37 { 37 {
38 return adoptPtrWillBeNoop(new PendingScript(element, resource)); 38 return (new PendingScript(element, resource));
39 } 39 }
40 40
41 PendingScript::PendingScript(Element* element, ScriptResource* resource) 41 PendingScript::PendingScript(Element* element, ScriptResource* resource)
42 : m_watchingForLoad(false) 42 : m_watchingForLoad(false)
43 , m_element(element) 43 , m_element(element)
44 , m_integrityFailure(false) 44 , m_integrityFailure(false)
45 , m_client(nullptr) 45 , m_client(nullptr)
46 { 46 {
47 setScriptResource(resource); 47 setScriptResource(resource);
48 #if ENABLE(OILPAN) 48 #if ENABLE(OILPAN)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 ASSERT(resource()); 106 ASSERT(resource());
107 if (m_client) 107 if (m_client)
108 m_client->notifyFinished(resource()); 108 m_client->notifyFinished(resource());
109 } 109 }
110 110
111 void PendingScript::setElement(Element* element) 111 void PendingScript::setElement(Element* element)
112 { 112 {
113 m_element = element; 113 m_element = element;
114 } 114 }
115 115
116 PassRefPtrWillBeRawPtr<Element> PendingScript::releaseElementAndClear() 116 RawPtr<Element> PendingScript::releaseElementAndClear()
117 { 117 {
118 setScriptResource(0); 118 setScriptResource(0);
119 m_watchingForLoad = false; 119 m_watchingForLoad = false;
120 m_startingPosition = TextPosition::belowRangePosition(); 120 m_startingPosition = TextPosition::belowRangePosition();
121 m_integrityFailure = false; 121 m_integrityFailure = false;
122 if (m_streamer) 122 if (m_streamer)
123 m_streamer->cancel(); 123 m_streamer->cancel();
124 m_streamer.release(); 124 m_streamer.release();
125 return m_element.release(); 125 return m_element.release();
126 } 126 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 errorOccurred = resource()->errorOccurred() || m_integrityFailure; 195 errorOccurred = resource()->errorOccurred() || m_integrityFailure;
196 ASSERT(resource()->isLoaded()); 196 ASSERT(resource()->isLoaded());
197 if (m_streamer && !m_streamer->streamingSuppressed()) 197 if (m_streamer && !m_streamer->streamingSuppressed())
198 return ScriptSourceCode(m_streamer, resource()); 198 return ScriptSourceCode(m_streamer, resource());
199 return ScriptSourceCode(resource()); 199 return ScriptSourceCode(resource());
200 } 200 }
201 errorOccurred = false; 201 errorOccurred = false;
202 return ScriptSourceCode(m_element->textContent(), documentURL, startingPosit ion()); 202 return ScriptSourceCode(m_element->textContent(), documentURL, startingPosit ion());
203 } 203 }
204 204
205 void PendingScript::setStreamer(PassRefPtrWillBeRawPtr<ScriptStreamer> streamer) 205 void PendingScript::setStreamer(RawPtr<ScriptStreamer> streamer)
206 { 206 {
207 ASSERT(!m_streamer); 207 ASSERT(!m_streamer);
208 ASSERT(!m_watchingForLoad); 208 ASSERT(!m_watchingForLoad);
209 m_streamer = streamer; 209 m_streamer = streamer;
210 } 210 }
211 211
212 bool PendingScript::isReady() const 212 bool PendingScript::isReady() const
213 { 213 {
214 if (resource() && !resource()->isLoaded()) 214 if (resource() && !resource()->isLoaded())
215 return false; 215 return false;
216 if (m_streamer && !m_streamer->isFinished()) 216 if (m_streamer && !m_streamer->isFinished())
217 return false; 217 return false;
218 return true; 218 return true;
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698