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

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

Issue 17761003: Remove FileException (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile warning Created 7 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 | « Source/core/fileapi/FileReaderLoader.h ('k') | Source/core/fileapi/FileReaderLoaderClient.h » ('j') | 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 : m_readType(readType) 58 : m_readType(readType)
59 , m_client(client) 59 , m_client(client)
60 , m_isRawDataConverted(false) 60 , m_isRawDataConverted(false)
61 , m_stringResult("") 61 , m_stringResult("")
62 , m_variableLength(false) 62 , m_variableLength(false)
63 , m_bytesLoaded(0) 63 , m_bytesLoaded(0)
64 , m_totalBytes(0) 64 , m_totalBytes(0)
65 , m_hasRange(false) 65 , m_hasRange(false)
66 , m_rangeStart(0) 66 , m_rangeStart(0)
67 , m_rangeEnd(0) 67 , m_rangeEnd(0)
68 , m_errorCode(0) 68 , m_errorCode(FileError::OK)
69 { 69 {
70 } 70 }
71 71
72 FileReaderLoader::~FileReaderLoader() 72 FileReaderLoader::~FileReaderLoader()
73 { 73 {
74 terminate(); 74 terminate();
75 if (!m_urlForReading.isEmpty()) 75 if (!m_urlForReading.isEmpty())
76 BlobRegistry::unregisterBlobURL(m_urlForReading); 76 BlobRegistry::unregisterBlobURL(m_urlForReading);
77 } 77 }
78 78
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 void FileReaderLoader::didFail(const ResourceError&) 232 void FileReaderLoader::didFail(const ResourceError&)
233 { 233 {
234 // If we're aborting, do not proceed with normal error handling since it is covered in aborting code. 234 // If we're aborting, do not proceed with normal error handling since it is covered in aborting code.
235 if (m_errorCode == FileError::ABORT_ERR) 235 if (m_errorCode == FileError::ABORT_ERR)
236 return; 236 return;
237 237
238 failed(FileError::NOT_READABLE_ERR); 238 failed(FileError::NOT_READABLE_ERR);
239 } 239 }
240 240
241 void FileReaderLoader::failed(int errorCode) 241 void FileReaderLoader::failed(FileError::ErrorCode errorCode)
242 { 242 {
243 m_errorCode = errorCode; 243 m_errorCode = errorCode;
244 cleanup(); 244 cleanup();
245 if (m_client) 245 if (m_client)
246 m_client->didFail(m_errorCode); 246 m_client->didFail(m_errorCode);
247 } 247 }
248 248
249 FileError::ErrorCode FileReaderLoader::httpStatusCodeToErrorCode(int httpStatusC ode) 249 FileError::ErrorCode FileReaderLoader::httpStatusCodeToErrorCode(int httpStatusC ode)
250 { 250 {
251 switch (httpStatusCode) { 251 switch (httpStatusCode) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 void FileReaderLoader::setRange(unsigned start, unsigned length) 388 void FileReaderLoader::setRange(unsigned start, unsigned length)
389 { 389 {
390 ASSERT(length > 0); 390 ASSERT(length > 0);
391 m_hasRange = true; 391 m_hasRange = true;
392 m_rangeStart = start; 392 m_rangeStart = start;
393 m_rangeEnd = start + length - 1; 393 m_rangeEnd = start + length - 1;
394 } 394 }
395 #endif // ENABLE(STREAM) 395 #endif // ENABLE(STREAM)
396 396
397 } // namespace WebCore 397 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.h ('k') | Source/core/fileapi/FileReaderLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698