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

Side by Side Diff: sky/engine/core/html/imports/HTMLImportLoader.cpp

Issue 682913002: Don't crash when importing a 404 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return StateLoaded; 114 return StateLoaded;
115 } 115 }
116 116
117 void HTMLImportLoader::setState(State state) 117 void HTMLImportLoader::setState(State state)
118 { 118 {
119 if (m_state == state) 119 if (m_state == state)
120 return; 120 return;
121 121
122 m_state = state; 122 m_state = state;
123 123
124 if (m_state == StateParsed || m_state == StateError || m_state == StateWritt en) 124 if (m_state == StateParsed || m_state == StateError || m_state == StateWritt en) {
125 m_document->cancelParsing(); 125 if (m_document)
126 m_document->cancelParsing();
127 }
126 128
127 // Since DocumentWriter::end() can let setState() reenter, we shouldn't refe r to m_state here. 129 // Since DocumentWriter::end() can let setState() reenter, we shouldn't refe r to m_state here.
128 if (state == StateLoaded || state == StateError) 130 if (state == StateLoaded || state == StateError)
129 didFinishLoading(); 131 didFinishLoading();
130 } 132 }
131 133
132 void HTMLImportLoader::didFinishParsing() 134 void HTMLImportLoader::didFinishParsing()
133 { 135 {
134 setState(finishParsing()); 136 setState(finishParsing());
135 setState(finishLoading()); 137 setState(finishLoading());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 { 191 {
190 visitor->trace(m_controller); 192 visitor->trace(m_controller);
191 #if ENABLE(OILPAN) 193 #if ENABLE(OILPAN)
192 visitor->trace(m_imports); 194 visitor->trace(m_imports);
193 #endif 195 #endif
194 visitor->trace(m_document); 196 visitor->trace(m_document);
195 visitor->trace(m_microtaskQueue); 197 visitor->trace(m_microtaskQueue);
196 } 198 }
197 199
198 } // namespace blink 200 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/ScriptController.cpp ('k') | sky/tests/modules/imports-can-load-404s.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698