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

Side by Side Diff: Source/WebCore/fileapi/FileReader.cpp

Issue 10908101: Merge 127082 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « LayoutTests/fast/files/file-reader-immediate-abort-expected.txt ('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) 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 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 static void delayedAbort(ScriptExecutionContext*, FileReader* reader) 155 static void delayedAbort(ScriptExecutionContext*, FileReader* reader)
156 { 156 {
157 reader->doAbort(); 157 reader->doAbort();
158 } 158 }
159 159
160 void FileReader::abort() 160 void FileReader::abort()
161 { 161 {
162 LOG(FileAPI, "FileReader: aborting\n"); 162 LOG(FileAPI, "FileReader: aborting\n");
163 163
164 if (m_aborting) 164 if (m_aborting || m_state != LOADING)
165 return; 165 return;
166 m_aborting = true; 166 m_aborting = true;
167 167
168 // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stac k. 168 // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stac k.
169 scriptExecutionContext()->postTask( 169 scriptExecutionContext()->postTask(
170 createCallbackTask(&delayedAbort, AllowAccessLater(this))); 170 createCallbackTask(&delayedAbort, AllowAccessLater(this)));
171 } 171 }
172 172
173 void FileReader::doAbort() 173 void FileReader::doAbort()
174 { 174 {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 String FileReader::stringResult() 258 String FileReader::stringResult()
259 { 259 {
260 if (!m_loader || m_error) 260 if (!m_loader || m_error)
261 return String(); 261 return String();
262 return m_loader->stringResult(); 262 return m_loader->stringResult();
263 } 263 }
264 264
265 } // namespace WebCore 265 } // namespace WebCore
266 266
267 #endif // ENABLE(BLOB) 267 #endif // ENABLE(BLOB)
OLDNEW
« no previous file with comments | « LayoutTests/fast/files/file-reader-immediate-abort-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698