| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "platform/network/HTTPParsers.h" | 36 #include "platform/network/HTTPParsers.h" |
| 37 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 38 #include "platform/weborigin/Referrer.h" | 38 #include "platform/weborigin/Referrer.h" |
| 39 #include "platform/weborigin/SecurityOrigin.h" | 39 #include "platform/weborigin/SecurityOrigin.h" |
| 40 #include "platform/wtf/RefCounted.h" | 40 #include "platform/wtf/RefCounted.h" |
| 41 #include "public/platform/WebAddressSpace.h" | 41 #include "public/platform/WebAddressSpace.h" |
| 42 #include "public/platform/WebURLRequest.h" | 42 #include "public/platform/WebURLRequest.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 enum class WebCachePolicy; | 46 enum class WebCachePolicy : uint8_t; |
| 47 | 47 |
| 48 enum class ResourceRequestBlockedReason { | 48 enum class ResourceRequestBlockedReason { |
| 49 CSP, | 49 CSP, |
| 50 kMixedContent, | 50 kMixedContent, |
| 51 kOrigin, | 51 kOrigin, |
| 52 kInspector, | 52 kInspector, |
| 53 kSubresourceFilter, | 53 kSubresourceFilter, |
| 54 kOther, | 54 kOther, |
| 55 kNone | 55 kNone |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 enum InputToLoadPerfMetricReportPolicy { | 58 enum InputToLoadPerfMetricReportPolicy : uint8_t { |
| 59 kNoReport, // Don't report metrics for this ResourceRequest. | 59 kNoReport, // Don't report metrics for this ResourceRequest. |
| 60 kReportLink, // Report metrics for this request as initiated by a link click. | 60 kReportLink, // Report metrics for this request as initiated by a link click. |
| 61 kReportIntent, // Report metrics for this request as initiated by an intent. | 61 kReportIntent, // Report metrics for this request as initiated by an intent. |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 struct CrossThreadResourceRequestData; | 64 struct CrossThreadResourceRequestData; |
| 65 | 65 |
| 66 class PLATFORM_EXPORT ResourceRequest final { | 66 class PLATFORM_EXPORT ResourceRequest final { |
| 67 DISALLOW_NEW(); | 67 DISALLOW_NEW(); |
| 68 | 68 |
| 69 public: | 69 public: |
| 70 enum class RedirectStatus { kFollowedRedirect, kNoRedirect }; | 70 enum class RedirectStatus : uint8_t { kFollowedRedirect, kNoRedirect }; |
| 71 | 71 |
| 72 class ExtraData : public RefCounted<ExtraData> { | 72 class ExtraData : public RefCounted<ExtraData> { |
| 73 public: | 73 public: |
| 74 virtual ~ExtraData() {} | 74 virtual ~ExtraData() {} |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 ResourceRequest(); | 77 ResourceRequest(); |
| 78 explicit ResourceRequest(const String& url_string); | 78 explicit ResourceRequest(const String& url_string); |
| 79 explicit ResourceRequest(const KURL&); | 79 explicit ResourceRequest(const KURL&); |
| 80 explicit ResourceRequest(CrossThreadResourceRequestData*); | 80 explicit ResourceRequest(CrossThreadResourceRequestData*); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 is_same_document_navigation_ = is_same_document; | 328 is_same_document_navigation_ = is_same_document; |
| 329 } | 329 } |
| 330 bool IsSameDocumentNavigation() const { return is_same_document_navigation_; } | 330 bool IsSameDocumentNavigation() const { return is_same_document_navigation_; } |
| 331 | 331 |
| 332 private: | 332 private: |
| 333 const CacheControlHeader& GetCacheControlHeader() const; | 333 const CacheControlHeader& GetCacheControlHeader() const; |
| 334 | 334 |
| 335 bool NeedsHTTPOrigin() const; | 335 bool NeedsHTTPOrigin() const; |
| 336 | 336 |
| 337 KURL url_; | 337 KURL url_; |
| 338 WebCachePolicy cache_policy_; | |
| 339 double timeout_interval_; // 0 is a magic value for platform default on | 338 double timeout_interval_; // 0 is a magic value for platform default on |
| 340 // platforms that have one. | 339 // platforms that have one. |
| 341 KURL first_party_for_cookies_; | 340 KURL first_party_for_cookies_; |
| 342 RefPtr<SecurityOrigin> requestor_origin_; | 341 RefPtr<SecurityOrigin> requestor_origin_; |
| 343 AtomicString http_method_; | 342 AtomicString http_method_; |
| 344 HTTPHeaderMap http_header_fields_; | 343 HTTPHeaderMap http_header_fields_; |
| 345 RefPtr<EncodedFormData> http_body_; | 344 RefPtr<EncodedFormData> http_body_; |
| 346 RefPtr<EncodedFormData> attached_credential_; | 345 RefPtr<EncodedFormData> attached_credential_; |
| 347 bool allow_stored_credentials_ : 1; | 346 bool allow_stored_credentials_ : 1; |
| 348 bool report_upload_progress_ : 1; | 347 bool report_upload_progress_ : 1; |
| 349 bool report_raw_headers_ : 1; | 348 bool report_raw_headers_ : 1; |
| 350 bool has_user_gesture_ : 1; | 349 bool has_user_gesture_ : 1; |
| 351 bool download_to_file_ : 1; | 350 bool download_to_file_ : 1; |
| 352 bool use_stream_on_response_ : 1; | 351 bool use_stream_on_response_ : 1; |
| 353 bool keepalive_ : 1; | 352 bool keepalive_ : 1; |
| 354 bool should_reset_app_cache_ : 1; | 353 bool should_reset_app_cache_ : 1; |
| 354 WebCachePolicy cache_policy_; |
| 355 WebURLRequest::ServiceWorkerMode service_worker_mode_; | 355 WebURLRequest::ServiceWorkerMode service_worker_mode_; |
| 356 ResourceLoadPriority priority_; | 356 ResourceLoadPriority priority_; |
| 357 int intra_priority_value_; | 357 int intra_priority_value_; |
| 358 int requestor_id_; | 358 int requestor_id_; |
| 359 int requestor_process_id_; | 359 int requestor_process_id_; |
| 360 int app_cache_host_id_; | 360 int app_cache_host_id_; |
| 361 WebURLRequest::PreviewsState previews_state_; |
| 361 RefPtr<ExtraData> extra_data_; | 362 RefPtr<ExtraData> extra_data_; |
| 362 WebURLRequest::RequestContext request_context_; | 363 WebURLRequest::RequestContext request_context_; |
| 363 WebURLRequest::FrameType frame_type_; | 364 WebURLRequest::FrameType frame_type_; |
| 364 WebURLRequest::FetchRequestMode fetch_request_mode_; | 365 WebURLRequest::FetchRequestMode fetch_request_mode_; |
| 365 WebURLRequest::FetchCredentialsMode fetch_credentials_mode_; | 366 WebURLRequest::FetchCredentialsMode fetch_credentials_mode_; |
| 366 WebURLRequest::FetchRedirectMode fetch_redirect_mode_; | 367 WebURLRequest::FetchRedirectMode fetch_redirect_mode_; |
| 367 WebURLRequest::PreviewsState previews_state_; | |
| 368 ReferrerPolicy referrer_policy_; | 368 ReferrerPolicy referrer_policy_; |
| 369 bool did_set_http_referrer_; | 369 bool did_set_http_referrer_; |
| 370 bool check_for_browser_side_navigation_; | 370 bool check_for_browser_side_navigation_; |
| 371 double ui_start_time_; | 371 double ui_start_time_; |
| 372 bool is_external_request_; | 372 bool is_external_request_; |
| 373 WebURLRequest::LoadingIPCType loading_ipc_type_; | 373 WebURLRequest::LoadingIPCType loading_ipc_type_; |
| 374 bool is_same_document_navigation_; | 374 bool is_same_document_navigation_; |
| 375 InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_; | 375 InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_; |
| 376 RedirectStatus redirect_status_; |
| 376 | 377 |
| 377 mutable CacheControlHeader cache_control_header_cache_; | 378 mutable CacheControlHeader cache_control_header_cache_; |
| 378 | 379 |
| 379 static double default_timeout_interval_; | 380 static double default_timeout_interval_; |
| 380 | 381 |
| 381 RedirectStatus redirect_status_; | |
| 382 | |
| 383 double navigation_start_ = 0; | 382 double navigation_start_ = 0; |
| 384 }; | 383 }; |
| 385 | 384 |
| 386 struct CrossThreadResourceRequestData { | 385 struct CrossThreadResourceRequestData { |
| 387 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); | 386 WTF_MAKE_NONCOPYABLE(CrossThreadResourceRequestData); |
| 388 USING_FAST_MALLOC(CrossThreadResourceRequestData); | 387 USING_FAST_MALLOC(CrossThreadResourceRequestData); |
| 389 | 388 |
| 390 public: | 389 public: |
| 391 CrossThreadResourceRequestData() {} | 390 CrossThreadResourceRequestData() {} |
| 392 KURL url_; | 391 KURL url_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 double ui_start_time_; | 424 double ui_start_time_; |
| 426 bool is_external_request_; | 425 bool is_external_request_; |
| 427 WebURLRequest::LoadingIPCType loading_ipc_type_; | 426 WebURLRequest::LoadingIPCType loading_ipc_type_; |
| 428 InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_; | 427 InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_; |
| 429 ResourceRequest::RedirectStatus redirect_status_; | 428 ResourceRequest::RedirectStatus redirect_status_; |
| 430 }; | 429 }; |
| 431 | 430 |
| 432 } // namespace blink | 431 } // namespace blink |
| 433 | 432 |
| 434 #endif // ResourceRequest_h | 433 #endif // ResourceRequest_h |
| OLD | NEW |