| 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 496 m_reader->setOnerror(this); | 496 m_reader->setOnerror(this); |
| 497 | 497 |
| 498 m_reader->readAsArrayBuffer(blob.get(), IGNORE_EXCEPTION_STATE); | 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) { |
| 507 String result = base64Encode(static_cast<char*>(buffer->data()), buffer-
>byteLength()); | 507 String result = base64Encode(static_cast<char*>(buffer->data()), buffer-
>byteLength()); |
| 508 reportResult(static_cast<FileError::ErrorCode>(0), &result, 0); | 508 reportResult(static_cast<FileError::ErrorCode>(0), &result, 0); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->
traverseNext()) { | 725 for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->
traverseNext()) { |
| 726 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) | 726 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) |
| 727 return frame->document(); | 727 return frame->document(); |
| 728 } | 728 } |
| 729 | 729 |
| 730 *error = "No frame is available for the request"; | 730 *error = "No frame is available for the request"; |
| 731 return 0; | 731 return 0; |
| 732 } | 732 } |
| 733 | 733 |
| 734 } // namespace WebCore | 734 } // namespace WebCore |
| OLD | NEW |