OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 toFileEntry(entry)->file(successCallback.release(), errorCallback.release())
; | 463 toFileEntry(entry)->file(successCallback.release(), errorCallback.release())
; |
464 | 464 |
465 m_reader = FileReader::create(entry->filesystem()->executionContext()); | 465 m_reader = FileReader::create(entry->filesystem()->executionContext()); |
466 m_mimeType = MIMETypeRegistry::getMIMETypeForPath(entry->name()); | 466 m_mimeType = MIMETypeRegistry::getMIMETypeForPath(entry->name()); |
467 | 467 |
468 return true; | 468 return true; |
469 } | 469 } |
470 | 470 |
471 bool FileContentRequest::didGetFile(File* file) | 471 bool FileContentRequest::didGetFile(File* file) |
472 { | 472 { |
473 RefPtr<Blob> blob = file->slice(m_start, m_end); | 473 RefPtr<Blob> blob = static_cast<Blob*>(file)->slice(m_start, m_end, IGNORE_E
XCEPTION); |
474 m_reader->setOnload(this); | 474 m_reader->setOnload(this); |
475 m_reader->setOnerror(this); | 475 m_reader->setOnerror(this); |
476 | 476 |
477 m_reader->readAsArrayBuffer(blob.get(), IGNORE_EXCEPTION); | 477 m_reader->readAsArrayBuffer(blob.get(), IGNORE_EXCEPTION); |
478 return true; | 478 return true; |
479 } | 479 } |
480 | 480 |
481 void FileContentRequest::didRead() | 481 void FileContentRequest::didRead() |
482 { | 482 { |
483 RefPtr<ArrayBuffer> buffer = m_reader->arrayBufferResult(); | 483 RefPtr<ArrayBuffer> buffer = m_reader->arrayBufferResult(); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) { | 717 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) { |
718 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) | 718 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) |
719 return frame->document(); | 719 return frame->document(); |
720 } | 720 } |
721 | 721 |
722 *error = "No frame is available for the request"; | 722 *error = "No frame is available for the request"; |
723 return 0; | 723 return 0; |
724 } | 724 } |
725 | 725 |
726 } // namespace WebCore | 726 } // namespace WebCore |
OLD | NEW |