Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/WebKit/Source/core/fetch/FetchRequest.cpp

Issue 2389643002: Reflow comments in core/fetch (Closed)
Patch Set: yoavs comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google, Inc. All rights reserved. 2 * Copyright (C) 2012 Google, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FetchRequest::~FetchRequest() {} 72 FetchRequest::~FetchRequest() {}
73 73
74 void FetchRequest::setCrossOriginAccessControl( 74 void FetchRequest::setCrossOriginAccessControl(
75 SecurityOrigin* origin, 75 SecurityOrigin* origin,
76 CrossOriginAttributeValue crossOrigin) { 76 CrossOriginAttributeValue crossOrigin) {
77 DCHECK_NE(crossOrigin, CrossOriginAttributeNotSet); 77 DCHECK_NE(crossOrigin, CrossOriginAttributeNotSet);
78 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredentials; 78 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredentials;
79 const bool isSameOriginRequest = 79 const bool isSameOriginRequest =
80 origin && origin->canRequestNoSuborigin(m_resourceRequest.url()); 80 origin && origin->canRequestNoSuborigin(m_resourceRequest.url());
81 81
82 // Currently FetchRequestMode and FetchCredentialsMode are only used when the request goes to Service Worker. 82 // Currently FetchRequestMode and FetchCredentialsMode are only used when the
83 // request goes to Service Worker.
83 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS); 84 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS);
84 m_resourceRequest.setFetchCredentialsMode( 85 m_resourceRequest.setFetchCredentialsMode(
85 useCredentials ? WebURLRequest::FetchCredentialsModeInclude 86 useCredentials ? WebURLRequest::FetchCredentialsModeInclude
86 : WebURLRequest::FetchCredentialsModeSameOrigin); 87 : WebURLRequest::FetchCredentialsModeSameOrigin);
87 88
88 m_options.allowCredentials = (isSameOriginRequest || useCredentials) 89 m_options.allowCredentials = (isSameOriginRequest || useCredentials)
89 ? AllowStoredCredentials 90 ? AllowStoredCredentials
90 : DoNotAllowStoredCredentials; 91 : DoNotAllowStoredCredentials;
91 m_options.corsEnabled = IsCORSEnabled; 92 m_options.corsEnabled = IsCORSEnabled;
92 m_options.securityOrigin = origin; 93 m_options.securityOrigin = origin;
(...skipping 11 matching lines...) Expand all
104 m_resourceWidth.isSet = true; 105 m_resourceWidth.isSet = true;
105 } 106 }
106 } 107 }
107 108
108 void FetchRequest::setForPreload(bool forPreload, double discoveryTime) { 109 void FetchRequest::setForPreload(bool forPreload, double discoveryTime) {
109 m_forPreload = forPreload; 110 m_forPreload = forPreload;
110 m_preloadDiscoveryTime = discoveryTime; 111 m_preloadDiscoveryTime = discoveryTime;
111 } 112 }
112 113
113 void FetchRequest::makeSynchronous() { 114 void FetchRequest::makeSynchronous() {
114 // Synchronous requests should always be max priority, lest they hang the rend erer. 115 // Synchronous requests should always be max priority, lest they hang the
116 // renderer.
115 m_resourceRequest.setPriority(ResourceLoadPriorityHighest); 117 m_resourceRequest.setPriority(ResourceLoadPriorityHighest);
116 m_resourceRequest.setTimeoutInterval(10); 118 m_resourceRequest.setTimeoutInterval(10);
117 m_options.synchronousPolicy = RequestSynchronously; 119 m_options.synchronousPolicy = RequestSynchronously;
118 } 120 }
119 121
120 } // namespace blink 122 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchContext.h ('k') | third_party/WebKit/Source/core/fetch/ImageResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698