Commit 038eb084 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Include url_loader_factory.mojom-blink-forward.h instead of...

Include url_loader_factory.mojom-blink-forward.h instead of url_loader_factory.mojom-blink.h in resource_loader_options.h

This CL reduces the estimated pre-processed size of
resource_loader_options.h from 3.53MB to 0.89MB.

Bug: 1001360
Change-Id: If3406a954fbe94f8a0486b0a73a32f5c312aaa31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810508Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697563}
parent 756493ea
...@@ -77,6 +77,7 @@ blink_platform_sources("loader") { ...@@ -77,6 +77,7 @@ blink_platform_sources("loader") {
"fetch/resource_load_timing.h", "fetch/resource_load_timing.h",
"fetch/resource_loader.cc", "fetch/resource_loader.cc",
"fetch/resource_loader.h", "fetch/resource_loader.h",
"fetch/resource_loader_options.cc",
"fetch/resource_loader_options.h", "fetch/resource_loader_options.h",
"fetch/resource_loading_log.h", "fetch/resource_loading_log.h",
"fetch/resource_priority.h", "fetch/resource_priority.h",
......
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "third_party/blink/renderer/platform/loader/fetch/resource_loader_options.h"
#include "services/network/public/mojom/url_loader_factory.mojom-blink.h"
namespace blink {
ResourceLoaderOptions::ResourceLoaderOptions()
: data_buffering_policy(kBufferData),
content_security_policy_option(kCheckContentSecurityPolicy),
request_initiator_context(kDocumentContext),
synchronous_policy(kRequestAsynchronously),
cors_handling_by_resource_fetcher(kEnableCorsHandlingByResourceFetcher),
cors_flag(false),
parser_disposition(kParserInserted),
cache_aware_loading_enabled(kNotCacheAwareLoadingEnabled) {}
ResourceLoaderOptions::ResourceLoaderOptions(
const ResourceLoaderOptions& other) = default;
ResourceLoaderOptions& ResourceLoaderOptions::operator=(
const ResourceLoaderOptions& other) = default;
ResourceLoaderOptions::~ResourceLoaderOptions() = default;
} // namespace blink
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_RESOURCE_LOADER_OPTIONS_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_RESOURCE_LOADER_OPTIONS_H_
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "services/network/public/mojom/url_loader_factory.mojom-blink.h" #include "services/network/public/mojom/url_loader_factory.mojom-blink-forward.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_initiator_info.h" #include "third_party/blink/renderer/platform/loader/fetch/fetch_initiator_info.h"
#include "third_party/blink/renderer/platform/loader/fetch/integrity_metadata.h" #include "third_party/blink/renderer/platform/loader/fetch/integrity_metadata.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
...@@ -74,19 +75,18 @@ enum CacheAwareLoadingEnabled : uint8_t { ...@@ -74,19 +75,18 @@ enum CacheAwareLoadingEnabled : uint8_t {
}; };
// This class is thread-bound. Do not copy/pass an instance across threads. // This class is thread-bound. Do not copy/pass an instance across threads.
struct ResourceLoaderOptions { struct PLATFORM_EXPORT ResourceLoaderOptions {
USING_FAST_MALLOC(ResourceLoaderOptions); USING_FAST_MALLOC(ResourceLoaderOptions);
public: public:
ResourceLoaderOptions() // We define constructors, destructor, and assignment operator in
: data_buffering_policy(kBufferData), // resource_loader_options.cc because they require the full definition of
content_security_policy_option(kCheckContentSecurityPolicy), // URLLoaderFactory for |url_loader_factory| data member, and we'd like
request_initiator_context(kDocumentContext), // to avoid to include huge url_loader_factory.mojom-blink.h.
synchronous_policy(kRequestAsynchronously), ResourceLoaderOptions();
cors_handling_by_resource_fetcher(kEnableCorsHandlingByResourceFetcher), ResourceLoaderOptions(const ResourceLoaderOptions& other);
cors_flag(false), ResourceLoaderOptions& operator=(const ResourceLoaderOptions& other);
parser_disposition(kParserInserted), ~ResourceLoaderOptions();
cache_aware_loading_enabled(kNotCacheAwareLoadingEnabled) {}
FetchInitiatorInfo initiator_info; FetchInitiatorInfo initiator_info;
......
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