| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/FormDataBytesConsumer.h" | 5 #include "modules/fetch/FormDataBytesConsumer.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMArrayBuffer.h" | 7 #include "core/dom/DOMArrayBuffer.h" |
| 8 #include "core/dom/DOMTypedArray.h" | 8 #include "core/dom/DOMTypedArray.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/html/FormData.h" | 10 #include "core/html/FormData.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 data->AppendFileSystemURLRange(KURL(KURL(), "file:///foo/bar/baz"), 6, 7, 8); | 41 data->AppendFileSystemURLRange(KURL(KURL(), "file:///foo/bar/baz"), 6, 7, 8); |
| 42 std::unique_ptr<BlobData> blob_data = BlobData::Create(); | 42 std::unique_ptr<BlobData> blob_data = BlobData::Create(); |
| 43 blob_data->AppendText("hello", false); | 43 blob_data->AppendText("hello", false); |
| 44 auto size = blob_data->length(); | 44 auto size = blob_data->length(); |
| 45 RefPtr<BlobDataHandle> blob_data_handle = | 45 RefPtr<BlobDataHandle> blob_data_handle = |
| 46 BlobDataHandle::Create(std::move(blob_data), size); | 46 BlobDataHandle::Create(std::move(blob_data), size); |
| 47 data->AppendBlob(blob_data_handle->Uuid(), blob_data_handle); | 47 data->AppendBlob(blob_data_handle->Uuid(), blob_data_handle); |
| 48 Vector<char> boundary; | 48 Vector<char> boundary; |
| 49 boundary.Append("\0", 1); | 49 boundary.Append("\0", 1); |
| 50 data->SetBoundary(boundary); | 50 data->SetBoundary(boundary); |
| 51 return data.Release(); | 51 return data; |
| 52 } | 52 } |
| 53 | 53 |
| 54 class NoopClient final : public GarbageCollectedFinalized<NoopClient>, | 54 class NoopClient final : public GarbageCollectedFinalized<NoopClient>, |
| 55 public BytesConsumer::Client { | 55 public BytesConsumer::Client { |
| 56 USING_GARBAGE_COLLECTED_MIXIN(NoopClient); | 56 USING_GARBAGE_COLLECTED_MIXIN(NoopClient); |
| 57 | 57 |
| 58 public: | 58 public: |
| 59 void OnStateChange() override {} | 59 void OnStateChange() override {} |
| 60 }; | 60 }; |
| 61 | 61 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 EXPECT_CALL(*underlying, Cancel()); | 376 EXPECT_CALL(*underlying, Cancel()); |
| 377 EXPECT_CALL(checkpoint, Call(2)); | 377 EXPECT_CALL(checkpoint, Call(2)); |
| 378 | 378 |
| 379 checkpoint.Call(1); | 379 checkpoint.Call(1); |
| 380 consumer->Cancel(); | 380 consumer->Cancel(); |
| 381 checkpoint.Call(2); | 381 checkpoint.Call(2); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace | 384 } // namespace |
| 385 } // namespace blink | 385 } // namespace blink |
| OLD | NEW |