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

Side by Side Diff: Source/platform/network/ResourceRequest.cpp

Issue 587213003: [ServiceWorker] Plumbing the request mode from the renderer to the ServiceWorker. [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 request->setHTTPMethod(AtomicString(data->m_httpMethod)); 43 request->setHTTPMethod(AtomicString(data->m_httpMethod));
44 request->setPriority(data->m_priority, data->m_intraPriorityValue); 44 request->setPriority(data->m_priority, data->m_intraPriorityValue);
45 45
46 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release()); 46 request->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
47 47
48 request->setHTTPBody(data->m_httpBody); 48 request->setHTTPBody(data->m_httpBody);
49 request->setAllowStoredCredentials(data->m_allowStoredCredentials); 49 request->setAllowStoredCredentials(data->m_allowStoredCredentials);
50 request->setReportUploadProgress(data->m_reportUploadProgress); 50 request->setReportUploadProgress(data->m_reportUploadProgress);
51 request->setHasUserGesture(data->m_hasUserGesture); 51 request->setHasUserGesture(data->m_hasUserGesture);
52 request->setDownloadToFile(data->m_downloadToFile); 52 request->setDownloadToFile(data->m_downloadToFile);
53 request->setSkipServiceWorker(data->m_skipServiceWorker);
54 request->setRequestorID(data->m_requestorID); 53 request->setRequestorID(data->m_requestorID);
55 request->setRequestorProcessID(data->m_requestorProcessID); 54 request->setRequestorProcessID(data->m_requestorProcessID);
56 request->setAppCacheHostID(data->m_appCacheHostID); 55 request->setAppCacheHostID(data->m_appCacheHostID);
57 request->setRequestContext(data->m_requestContext); 56 request->setRequestContext(data->m_requestContext);
58 request->setFrameType(data->m_frameType); 57 request->setFrameType(data->m_frameType);
58 request->setServiceWorkerRequestMode(data->m_serviceWorkerRequestMode);
59 request->m_referrerPolicy = data->m_referrerPolicy; 59 request->m_referrerPolicy = data->m_referrerPolicy;
60 return request.release(); 60 return request.release();
61 } 61 }
62 62
63 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const 63 PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::copyData() const
64 { 64 {
65 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour ceRequestData()); 65 OwnPtr<CrossThreadResourceRequestData> data = adoptPtr(new CrossThreadResour ceRequestData());
66 data->m_url = url().copy(); 66 data->m_url = url().copy();
67 data->m_cachePolicy = cachePolicy(); 67 data->m_cachePolicy = cachePolicy();
68 data->m_timeoutInterval = timeoutInterval(); 68 data->m_timeoutInterval = timeoutInterval();
69 data->m_firstPartyForCookies = firstPartyForCookies().copy(); 69 data->m_firstPartyForCookies = firstPartyForCookies().copy();
70 data->m_httpMethod = httpMethod().string().isolatedCopy(); 70 data->m_httpMethod = httpMethod().string().isolatedCopy();
71 data->m_httpHeaders = httpHeaderFields().copyData(); 71 data->m_httpHeaders = httpHeaderFields().copyData();
72 data->m_priority = priority(); 72 data->m_priority = priority();
73 data->m_intraPriorityValue = m_intraPriorityValue; 73 data->m_intraPriorityValue = m_intraPriorityValue;
74 74
75 if (m_httpBody) 75 if (m_httpBody)
76 data->m_httpBody = m_httpBody->deepCopy(); 76 data->m_httpBody = m_httpBody->deepCopy();
77 data->m_allowStoredCredentials = m_allowStoredCredentials; 77 data->m_allowStoredCredentials = m_allowStoredCredentials;
78 data->m_reportUploadProgress = m_reportUploadProgress; 78 data->m_reportUploadProgress = m_reportUploadProgress;
79 data->m_hasUserGesture = m_hasUserGesture; 79 data->m_hasUserGesture = m_hasUserGesture;
80 data->m_downloadToFile = m_downloadToFile; 80 data->m_downloadToFile = m_downloadToFile;
81 data->m_skipServiceWorker = m_skipServiceWorker;
82 data->m_requestorID = m_requestorID; 81 data->m_requestorID = m_requestorID;
83 data->m_requestorProcessID = m_requestorProcessID; 82 data->m_requestorProcessID = m_requestorProcessID;
84 data->m_appCacheHostID = m_appCacheHostID; 83 data->m_appCacheHostID = m_appCacheHostID;
85 data->m_requestContext = m_requestContext; 84 data->m_requestContext = m_requestContext;
86 data->m_frameType = m_frameType; 85 data->m_frameType = m_frameType;
86 data->m_serviceWorkerRequestMode = m_serviceWorkerRequestMode;
87 data->m_referrerPolicy = m_referrerPolicy; 87 data->m_referrerPolicy = m_referrerPolicy;
88 return data.release(); 88 return data.release();
89 } 89 }
90 90
91 bool ResourceRequest::isEmpty() const 91 bool ResourceRequest::isEmpty() const
92 { 92 {
93 return m_url.isEmpty(); 93 return m_url.isEmpty();
94 } 94 }
95 95
96 bool ResourceRequest::isNull() const 96 bool ResourceRequest::isNull() const
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 { 390 {
391 m_url = url; 391 m_url = url;
392 m_cachePolicy = cachePolicy; 392 m_cachePolicy = cachePolicy;
393 m_timeoutInterval = s_defaultTimeoutInterval; 393 m_timeoutInterval = s_defaultTimeoutInterval;
394 m_httpMethod = "GET"; 394 m_httpMethod = "GET";
395 m_allowStoredCredentials = true; 395 m_allowStoredCredentials = true;
396 m_reportUploadProgress = false; 396 m_reportUploadProgress = false;
397 m_reportRawHeaders = false; 397 m_reportRawHeaders = false;
398 m_hasUserGesture = false; 398 m_hasUserGesture = false;
399 m_downloadToFile = false; 399 m_downloadToFile = false;
400 m_skipServiceWorker = false;
401 m_priority = ResourceLoadPriorityLow; 400 m_priority = ResourceLoadPriorityLow;
402 m_intraPriorityValue = 0; 401 m_intraPriorityValue = 0;
403 m_requestorID = 0; 402 m_requestorID = 0;
404 m_requestorProcessID = 0; 403 m_requestorProcessID = 0;
405 m_appCacheHostID = 0; 404 m_appCacheHostID = 0;
406 m_requestContext = blink::WebURLRequest::RequestContextUnspecified; 405 m_requestContext = blink::WebURLRequest::RequestContextUnspecified;
407 m_frameType = blink::WebURLRequest::FrameTypeNone; 406 m_frameType = blink::WebURLRequest::FrameTypeNone;
407 m_serviceWorkerRequestMode = blink::WebURLRequest::ServiceWorkerRequestMode NoCORS;
408 m_referrerPolicy = ReferrerPolicyDefault; 408 m_referrerPolicy = ReferrerPolicyDefault;
409 } 409 }
410 410
411 // This is used by the loader to control the number of issued parallel load requ ests. 411 // This is used by the loader to control the number of issued parallel load requ ests.
412 unsigned initializeMaximumHTTPConnectionCountPerHost() 412 unsigned initializeMaximumHTTPConnectionCountPerHost()
413 { 413 {
414 // The chromium network stack already handles limiting the number of 414 // The chromium network stack already handles limiting the number of
415 // parallel requests per host, so there's no need to do it here. Therefore, 415 // parallel requests per host, so there's no need to do it here. Therefore,
416 // this is set to a high value that should never be hit in practice. 416 // this is set to a high value that should never be hit in practice.
417 return 10000; 417 return 10000;
418 } 418 }
419 419
420 } 420 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698