| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/fetch/FetchDataLoader.h" | 5 #include "modules/fetch/FetchDataLoader.h" |
| 6 | 6 |
| 7 #include "core/html/parser/TextResourceDecoder.h" | 7 #include "core/html/parser/TextResourceDecoder.h" |
| 8 #include "wtf/text/StringBuilder.h" | 8 #include "wtf/text/StringBuilder.h" |
| 9 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
| 10 #include "wtf/typed_arrays/ArrayBufferBuilder.h" | 10 #include "wtf/typed_arrays/ArrayBufferBuilder.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 switch (result) { | 68 switch (result) { |
| 69 case WebDataConsumerHandle::Ok: | 69 case WebDataConsumerHandle::Ok: |
| 70 m_blobData->appendBytes(buffer, available); | 70 m_blobData->appendBytes(buffer, available); |
| 71 m_reader->endRead(available); | 71 m_reader->endRead(available); |
| 72 break; | 72 break; |
| 73 | 73 |
| 74 case WebDataConsumerHandle::Done: { | 74 case WebDataConsumerHandle::Done: { |
| 75 m_reader.clear(); | 75 m_reader.clear(); |
| 76 long long size = m_blobData->length(); | 76 long long size = m_blobData->length(); |
| 77 m_client->didFetchDataLoadedBlobHandle(BlobDataHandle::create(m_
blobData.release(), size)); | 77 m_client->didFetchDataLoadedBlobHandle(BlobDataHandle::create(st
d::move(m_blobData), size)); |
| 78 m_client.clear(); | 78 m_client.clear(); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 | 81 |
| 82 case WebDataConsumerHandle::ShouldWait: | 82 case WebDataConsumerHandle::ShouldWait: |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 case WebDataConsumerHandle::Busy: | 85 case WebDataConsumerHandle::Busy: |
| 86 case WebDataConsumerHandle::ResourceExhausted: | 86 case WebDataConsumerHandle::ResourceExhausted: |
| 87 case WebDataConsumerHandle::UnexpectedError: | 87 case WebDataConsumerHandle::UnexpectedError: |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 { | 392 { |
| 393 return new FetchDataLoaderAsString(); | 393 return new FetchDataLoaderAsString(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 FetchDataLoader* FetchDataLoader::createLoaderAsStream(Stream* outStream) | 396 FetchDataLoader* FetchDataLoader::createLoaderAsStream(Stream* outStream) |
| 397 { | 397 { |
| 398 return new FetchDataLoaderAsStream(outStream); | 398 return new FetchDataLoaderAsStream(outStream); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace blink | 401 } // namespace blink |
| OLD | NEW |