Commit 686dd85e authored by Hiroki Nakagawa's avatar Hiroki Nakagawa Committed by Commit Bot

Fetch: Move modules/fetch to core/fetch (2)

This CL moves a part of files in modules/fetch to core/fetch.

Fetch is a primitive mechanism and should be available in core/. See the issue
for a use case.

Previous CLs:
(1) https://chromium-review.googlesource.com/c/chromium/src/+/841903

Bug: 794837
Change-Id: Ice42e2a201b9c6833232c94daa049550ce29e3ac
Reviewed-on: https://chromium-review.googlesource.com/842383
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526077}
parent 000b1305
......@@ -21,6 +21,8 @@ bindings_core_generated_union_type_files = [
"$bindings_core_v8_output_dir/array_buffer_or_array_buffer_view_or_blob_or_usv_string.h",
"$bindings_core_v8_output_dir/boolean_or_byte_string_byte_string_record.cc",
"$bindings_core_v8_output_dir/boolean_or_byte_string_byte_string_record.h",
"$bindings_core_v8_output_dir/byte_string_sequence_sequence_or_byte_string_byte_string_record.cc",
"$bindings_core_v8_output_dir/byte_string_sequence_sequence_or_byte_string_byte_string_record.h",
"$bindings_core_v8_output_dir/css_style_value_or_css_style_value_sequence.cc",
"$bindings_core_v8_output_dir/css_style_value_or_css_style_value_sequence.h",
"$bindings_core_v8_output_dir/css_style_value_or_string.cc",
......
......@@ -28,8 +28,6 @@ bindings_modules_generated_union_type_files = [
"$bindings_modules_v8_output_dir/boolean_or_constrain_boolean_parameters.h",
"$bindings_modules_v8_output_dir/boolean_or_media_track_constraints.cc",
"$bindings_modules_v8_output_dir/boolean_or_media_track_constraints.h",
"$bindings_modules_v8_output_dir/byte_string_sequence_sequence_or_byte_string_byte_string_record.cc",
"$bindings_modules_v8_output_dir/byte_string_sequence_sequence_or_byte_string_byte_string_record.h",
"$bindings_modules_v8_output_dir/canvas_image_source.cc",
"$bindings_modules_v8_output_dir/canvas_image_source.h",
"$bindings_modules_v8_output_dir/client_or_service_worker_or_message_port.cc",
......
......@@ -1767,6 +1767,7 @@ jumbo_source_set("unit_tests") {
"fetch/DataConsumerHandleTestUtil.cpp",
"fetch/DataConsumerHandleTestUtil.h",
"fetch/FetchDataLoaderTest.cpp",
"fetch/FetchHeaderListTest.cpp",
"fetch/FormDataBytesConsumerTest.cpp",
"fetch/MultipartParserTest.cpp",
"fetch/ReadableStreamBytesConsumerTest.cpp",
......
......@@ -166,6 +166,7 @@ core_idl_files =
"events/UIEvent.idl",
"events/WheelEvent.idl",
"fetch/Body.idl",
"fetch/Headers.idl",
"fileapi/Blob.idl",
"fileapi/File.idl",
"fileapi/FileList.idl",
......
......@@ -18,11 +18,11 @@ blink_core_sources("fetch") {
"BytesConsumerForDataConsumerHandle.h",
"FetchDataLoader.cpp",
"FetchDataLoader.h",
"FetchHeaderList.cpp",
"FetchHeaderList.h",
# TODO(nhiroki): Move these files from modules/fetch to core/fetch.
# (https://crbug.com/794837)
# "FetchHeaderList.cpp",
# "FetchHeaderList.h",
# "FetchManager.cpp",
# "FetchManager.h",
# "FetchRequestData.cpp",
......@@ -37,9 +37,9 @@ blink_core_sources("fetch") {
# (https://crbug.com/794837)
# "GlobalFetch.cpp",
# "GlobalFetch.h",
# "Headers.cpp",
# "Headers.h",
"Headers.cpp",
"Headers.h",
"MultipartParser.cpp",
"MultipartParser.h",
"ReadableStreamBytesConsumer.cpp",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "modules/fetch/FetchHeaderList.h"
#include "core/fetch/FetchHeaderList.h"
#include <algorithm>
#include <utility>
......
......@@ -7,7 +7,7 @@
#include <map>
#include <utility>
#include "modules/ModulesExport.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/Vector.h"
#include "platform/wtf/text/WTFString.h"
......@@ -15,7 +15,7 @@
namespace blink {
// http://fetch.spec.whatwg.org/#terminology-headers
class MODULES_EXPORT FetchHeaderList final
class CORE_EXPORT FetchHeaderList final
: public GarbageCollectedFinalized<FetchHeaderList> {
public:
struct ByteCaseInsensitiveCompare {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "modules/fetch/FetchHeaderList.h"
#include "core/fetch/FetchHeaderList.h"
#include <utility>
#include "platform/wtf/StdLibExtras.h"
......
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "modules/fetch/Headers.h"
#include "core/fetch/Headers.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8IteratorResultValue.h"
#include "bindings/modules/v8/byte_string_sequence_sequence_or_byte_string_byte_string_record.h"
#include "bindings/core/v8/byte_string_sequence_sequence_or_byte_string_byte_string_record.h"
#include "core/dom/Iterator.h"
#include "platform/loader/fetch/FetchUtils.h"
#include "platform/wtf/text/WTFString.h"
......@@ -212,7 +212,7 @@ void Headers::set(const String& name,
// classes. For example, when initializing a Request object it is possible that
// a Request's Headers must be filled with an existing Headers object.
void Headers::FillWith(const Headers* object, ExceptionState& exception_state) {
DCHECK(header_list_->size() == 0);
DCHECK_EQ(header_list_->size(), 0U);
for (const auto& header : object->header_list_->List()) {
append(header.first, header.second, exception_state);
if (exception_state.HadException())
......
......@@ -6,8 +6,8 @@
#define Headers_h
#include "bindings/core/v8/Iterable.h"
#include "modules/ModulesExport.h"
#include "modules/fetch/FetchHeaderList.h"
#include "core/CoreExport.h"
#include "core/fetch/FetchHeaderList.h"
#include "platform/bindings/ScriptState.h"
#include "platform/bindings/ScriptWrappable.h"
#include "platform/wtf/Forward.h"
......@@ -20,8 +20,8 @@ class ExceptionState;
using HeadersInit = ByteStringSequenceSequenceOrByteStringByteStringRecord;
// http://fetch.spec.whatwg.org/#headers-class
class MODULES_EXPORT Headers final : public ScriptWrappable,
public PairIterable<String, String> {
class CORE_EXPORT Headers final : public ScriptWrappable,
public PairIterable<String, String> {
DEFINE_WRAPPERTYPEINFO();
public:
......
......@@ -263,7 +263,6 @@ jumbo_source_set("unit_tests") {
"csspaint/PaintWorkletTest.cpp",
"document_metadata/CopylessPasteExtractorTest.cpp",
"eventsource/EventSourceParserTest.cpp",
"fetch/FetchHeaderListTest.cpp",
"fetch/FetchResponseDataTest.cpp",
"fetch/RequestTest.cpp",
"fetch/ResponseTest.cpp",
......
......@@ -6,8 +6,6 @@ import("//third_party/WebKit/Source/modules/modules.gni")
blink_modules_sources("fetch") {
sources = [
"FetchHeaderList.cpp",
"FetchHeaderList.h",
"FetchManager.cpp",
"FetchManager.h",
"FetchRequestData.cpp",
......@@ -16,8 +14,6 @@ blink_modules_sources("fetch") {
"FetchResponseData.h",
"GlobalFetch.cpp",
"GlobalFetch.h",
"Headers.cpp",
"Headers.h",
"Request.cpp",
"Request.h",
"RequestInit.cpp",
......
......@@ -8,9 +8,9 @@
#include "core/fetch/BlobBytesConsumer.h"
#include "core/fetch/BodyStreamBuffer.h"
#include "core/fetch/BytesConsumer.h"
#include "core/fetch/FetchHeaderList.h"
#include "core/fetch/FormDataBytesConsumer.h"
#include "core/loader/ThreadableLoader.h"
#include "modules/fetch/FetchHeaderList.h"
#include "platform/bindings/ScriptState.h"
#include "platform/loader/fetch/ResourceLoaderOptions.h"
#include "platform/loader/fetch/ResourceRequest.h"
......
......@@ -5,8 +5,8 @@
#include "modules/fetch/FetchResponseData.h"
#include "core/fetch/BodyStreamBuffer.h"
#include "core/fetch/FetchHeaderList.h"
#include "core/typed_arrays/DOMArrayBuffer.h"
#include "modules/fetch/FetchHeaderList.h"
#include "platform/bindings/ScriptState.h"
#include "platform/loader/fetch/FetchUtils.h"
#include "platform/network/http_names.h"
......
......@@ -4,8 +4,8 @@
#include "modules/fetch/FetchResponseData.h"
#include "core/fetch/FetchHeaderList.h"
#include "core/typed_arrays/DOMArrayBuffer.h"
#include "modules/fetch/FetchHeaderList.h"
#include "platform/blob/BlobData.h"
#include "platform/wtf/Vector.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
......
......@@ -8,9 +8,9 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/modules/v8/request_or_usv_string.h"
#include "core/fetch/Body.h"
#include "core/fetch/Headers.h"
#include "modules/ModulesExport.h"
#include "modules/fetch/FetchRequestData.h"
#include "modules/fetch/Headers.h"
#include "platform/bindings/ScriptWrappable.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
......
......@@ -16,12 +16,12 @@
#include "bindings/core/v8/V8URLSearchParams.h"
#include "core/fetch/BlobBytesConsumer.h"
#include "core/fetch/FormDataBytesConsumer.h"
#include "core/fetch/Headers.h"
#include "core/fileapi/Blob.h"
#include "core/frame/Deprecation.h"
#include "core/frame/UseCounter.h"
#include "core/html/forms/FormData.h"
#include "core/url/URLSearchParams.h"
#include "modules/fetch/Headers.h"
#include "platform/blob/BlobData.h"
#include "platform/network/EncodedFormData.h"
#include "platform/runtime_enabled_features.h"
......
......@@ -7,8 +7,8 @@
#include "base/memory/scoped_refptr.h"
#include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/modules/v8/byte_string_sequence_sequence_or_byte_string_byte_string_record.h"
#include "modules/fetch/Headers.h"
#include "bindings/core/v8/byte_string_sequence_sequence_or_byte_string_byte_string_record.h"
#include "core/fetch/Headers.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/Referrer.h"
#include "platform/wtf/Optional.h"
......
......@@ -9,9 +9,9 @@
#include "bindings/core/v8/ScriptValue.h"
#include "core/fetch/Body.h"
#include "core/fetch/BodyStreamBuffer.h"
#include "core/fetch/Headers.h"
#include "modules/ModulesExport.h"
#include "modules/fetch/FetchResponseData.h"
#include "modules/fetch/Headers.h"
#include "platform/bindings/ScriptWrappable.h"
#include "platform/blob/BlobData.h"
#include "platform/heap/Handle.h"
......
......@@ -116,7 +116,6 @@ modules_idl_files =
"encryptedmedia/MediaKeySystemAccess.idl",
"encryptedmedia/MediaKeys.idl",
"eventsource/EventSource.idl",
"fetch/Headers.idl",
"fetch/Request.idl",
"fetch/Response.idl",
"filesystem/DOMFileSystem.idl",
......
......@@ -37,6 +37,7 @@
#include "bindings/core/v8/SourceLocation.h"
#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
#include "core/dom/ExecutionContext.h"
#include "core/fetch/Headers.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/messaging/MessagePort.h"
......@@ -54,7 +55,6 @@
#include "modules/background_fetch/BackgroundFetchedEventInit.h"
#include "modules/background_sync/SyncEvent.h"
#include "modules/exported/WebEmbeddedWorkerImpl.h"
#include "modules/fetch/Headers.h"
#include "modules/notifications/Notification.h"
#include "modules/notifications/NotificationEvent.h"
#include "modules/notifications/NotificationEventInit.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment