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

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

Issue 2940553003: Failure in reading Blob URL should results in network error
Patch Set: . Created 3 years, 6 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
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 void FileReaderLoader::DidFail(const ResourceError& error) { 268 void FileReaderLoader::DidFail(const ResourceError& error) {
269 if (error.IsCancellation()) 269 if (error.IsCancellation())
270 return; 270 return;
271 // If we're aborting, do not proceed with normal error handling since it is 271 // If we're aborting, do not proceed with normal error handling since it is
272 // covered in aborting code. 272 // covered in aborting code.
273 if (error_code_ == FileError::kAbortErr) 273 if (error_code_ == FileError::kAbortErr)
274 return; 274 return;
275 275
276 if (error.IsFileNotFoundError()) {
277 Failed(FileError::kNotFoundErr);
278 return;
279 }
280
276 Failed(FileError::kNotReadableErr); 281 Failed(FileError::kNotReadableErr);
277 } 282 }
278 283
279 void FileReaderLoader::Failed(FileError::ErrorCode error_code) { 284 void FileReaderLoader::Failed(FileError::ErrorCode error_code) {
280 error_code_ = error_code; 285 error_code_ = error_code;
281 Cleanup(); 286 Cleanup();
282 if (client_) 287 if (client_)
283 client_->DidFail(error_code_); 288 client_->DidFail(error_code_);
284 } 289 }
285 290
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 400
396 return builder.ToString(); 401 return builder.ToString();
397 } 402 }
398 403
399 void FileReaderLoader::SetEncoding(const String& encoding) { 404 void FileReaderLoader::SetEncoding(const String& encoding) {
400 if (!encoding.IsEmpty()) 405 if (!encoding.IsEmpty())
401 encoding_ = WTF::TextEncoding(encoding); 406 encoding_ = WTF::TextEncoding(encoding);
402 } 407 }
403 408
404 } // namespace blink 409 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698