* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY

* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

#include"config.h"

#include"core/fileapi/FileReader.h"

#include"bindings/core/v8/ExceptionState.h"

#include"core/dom/CrossThreadTask.h"

#include"core/dom/Document.h"

#include"core/dom/ExceptionCode.h"

#include"core/dom/ExecutionContext.h"

#include"core/events/ProgressEvent.h"

#include"core/fileapi/File.h"

#include"core/frame/LocalFrame.h"

#include"core/inspector/InspectorInstrumentation.h"

#include"core/workers/WorkerClients.h"

#include"core/workers/WorkerGlobalScope.h"

#include"platform/Logging.h"

#include"platform/Supplementable.h"

#include"wtf/ArrayBuffer.h"

#include"wtf/CurrentTime.h"

#include"wtf/Deque.h"

#include"wtf/HashSet.h"

#include"wtf/text/CString.h"

namespace blink {

namespace{

#if !LOG_DISABLED

constCString utf8BlobUUID(Blob* blob)

{

return blob->uuid().utf8();

}

constCString utf8FilePath(Blob* blob)

{

return blob->hasBackingFile()? toFile(blob)->path().utf8():"";

}

#endif

}// namespace

// Embedders like chromium limit the number of simultaneous requests to avoid

// excessive IPC congestion. We limit this to 100 per thread to throttle the

// requests (the value is arbitrarily chosen).

staticconstsize_t kMaxOutstandingRequestsPerThread =100;

staticconstdouble progressNotificationIntervalMS =50;

// FIXME: Oilpan: if ExecutionContext is moved to the heap, consider

// making this object an ExecutionContext supplement (only.)

classFileReader::ThrottlingController FINAL :publicNoBaseWillBeGarbageCollectedFinalized<FileReader::ThrottlingController>,publicWillBeHeapSupplement<LocalFrame>,publicWillBeHeapSupplement<WorkerClients>{