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

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

Issue 478263002: Avoid GCing an aborting and stopped FileReader. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/resources/file-reader-abort-gc-iframe.html ('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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 terminate(); 236 terminate();
237 } 237 }
238 238
239 const AtomicString& FileReader::interfaceName() const 239 const AtomicString& FileReader::interfaceName() const
240 { 240 {
241 return EventTargetNames::FileReader; 241 return EventTargetNames::FileReader;
242 } 242 }
243 243
244 void FileReader::stop() 244 void FileReader::stop()
245 { 245 {
246 // The delayed abort task tidies up and advances to the DONE state.
247 if (m_loadingState == LoadingStateAborted)
248 return;
249
246 if (hasPendingActivity()) 250 if (hasPendingActivity())
247 ThrottlingController::finishReader(executionContext(), this, ThrottlingC ontroller::removeReader(executionContext(), this)); 251 ThrottlingController::finishReader(executionContext(), this, ThrottlingC ontroller::removeReader(executionContext(), this));
248 terminate(); 252 terminate();
249 } 253 }
250 254
251 bool FileReader::hasPendingActivity() const 255 bool FileReader::hasPendingActivity() const
252 { 256 {
253 return m_state == LOADING; 257 return m_state == LOADING;
254 } 258 }
255 259
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return m_loader->stringResult(); 498 return m_loader->stringResult();
495 } 499 }
496 500
497 void FileReader::trace(Visitor* visitor) 501 void FileReader::trace(Visitor* visitor)
498 { 502 {
499 visitor->trace(m_error); 503 visitor->trace(m_error);
500 EventTargetWithInlineData::trace(visitor); 504 EventTargetWithInlineData::trace(visitor);
501 } 505 }
502 506
503 } // namespace blink 507 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/files/resources/file-reader-abort-gc-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698