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

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

Issue 389193002: Fix condition of FileReader::hasPendingActivity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add layout tests Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/files/file-reader-abort-gc-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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 void FileReader::stop() 160 void FileReader::stop()
161 { 161 {
162 if (hasPendingActivity()) 162 if (hasPendingActivity())
163 throttlingController()->finishReader(this, throttlingController()->remov eReader(this)); 163 throttlingController()->finishReader(this, throttlingController()->remov eReader(this));
164 terminate(); 164 terminate();
165 } 165 }
166 166
167 bool FileReader::hasPendingActivity() const 167 bool FileReader::hasPendingActivity() const
168 { 168 {
169 return m_loadingState == LoadingStateLoading || m_loadingState == LoadingSta tePending; 169 return m_state == LOADING;
170 } 170 }
171 171
172 void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState) 172 void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState)
173 { 173 {
174 if (!blob) { 174 if (!blob) {
175 exceptionState.throwTypeError("The argument is not a Blob."); 175 exceptionState.throwTypeError("The argument is not a Blob.");
176 return; 176 return;
177 } 177 }
178 178
179 WTF_LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUI D(blob).data(), utf8FilePath(blob).data()); 179 WTF_LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUI D(blob).data(), utf8FilePath(blob).data());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return m_loader->stringResult(); 407 return m_loader->stringResult();
408 } 408 }
409 409
410 void FileReader::trace(Visitor* visitor) 410 void FileReader::trace(Visitor* visitor)
411 { 411 {
412 visitor->trace(m_error); 412 visitor->trace(m_error);
413 EventTargetWithInlineData::trace(visitor); 413 EventTargetWithInlineData::trace(visitor);
414 } 414 }
415 415
416 } // namespace WebCore 416 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/files/file-reader-abort-gc-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698