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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 m_reader = FileReader::create(entry->filesystem()->scriptExecutionContext())
; | 486 m_reader = FileReader::create(entry->filesystem()->scriptExecutionContext())
; |
487 m_mimeType = MIMETypeRegistry::getMIMETypeForPath(entry->name()); | 487 m_mimeType = MIMETypeRegistry::getMIMETypeForPath(entry->name()); |
488 | 488 |
489 return true; | 489 return true; |
490 } | 490 } |
491 | 491 |
492 bool FileContentRequest::didGetFile(File* file) | 492 bool FileContentRequest::didGetFile(File* file) |
493 { | 493 { |
494 RefPtr<Blob> blob = file->slice(m_start, m_end); | 494 RefPtr<Blob> blob = file->slice(m_start, m_end); |
495 m_reader->setOnload(this); | 495 m_reader->setOnload(this, 0); |
496 m_reader->setOnerror(this); | 496 m_reader->setOnerror(this, 0); |
497 | 497 |
498 m_reader->readAsArrayBuffer(blob.get(), IGNORE_EXCEPTION); | 498 m_reader->readAsArrayBuffer(blob.get(), IGNORE_EXCEPTION); |
499 return true; | 499 return true; |
500 } | 500 } |
501 | 501 |
502 void FileContentRequest::didRead() | 502 void FileContentRequest::didRead() |
503 { | 503 { |
504 RefPtr<ArrayBuffer> buffer = m_reader->arrayBufferResult(); | 504 RefPtr<ArrayBuffer> buffer = m_reader->arrayBufferResult(); |
505 | 505 |
506 if (!m_readAsText) { | 506 if (!m_readAsText) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->
traverseNext()) { | 727 for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->
traverseNext()) { |
728 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) | 728 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) |
729 return frame->document(); | 729 return frame->document(); |
730 } | 730 } |
731 | 731 |
732 *error = "No frame is available for the request"; | 732 *error = "No frame is available for the request"; |
733 return 0; | 733 return 0; |
734 } | 734 } |
735 | 735 |
736 } // namespace WebCore | 736 } // namespace WebCore |
OLD | NEW |