OLD | NEW |
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 { | 66 { |
67 m_options.initiatorInfo = initiator; | 67 m_options.initiatorInfo = initiator; |
68 } | 68 } |
69 | 69 |
70 FetchRequest::~FetchRequest() | 70 FetchRequest::~FetchRequest() |
71 { | 71 { |
72 } | 72 } |
73 | 73 |
74 void FetchRequest::setCrossOriginAccessControl(SecurityOrigin* origin, CrossOrig
inAttributeValue crossOrigin) | 74 void FetchRequest::setCrossOriginAccessControl(SecurityOrigin* origin, CrossOrig
inAttributeValue crossOrigin) |
75 { | 75 { |
76 ASSERT(crossOrigin != CrossOriginAttributeNotSet); | 76 DCHECK_NE(crossOrigin, CrossOriginAttributeNotSet); |
77 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredential
s; | 77 const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredential
s; |
78 const bool isSameOriginRequest = origin && origin->canRequestNoSuborigin(m_r
esourceRequest.url()); | 78 const bool isSameOriginRequest = origin && origin->canRequestNoSuborigin(m_r
esourceRequest.url()); |
79 | 79 |
80 // Currently FetchRequestMode and FetchCredentialsMode are only used when th
e request goes to Service Worker. | 80 // Currently FetchRequestMode and FetchCredentialsMode are only used when th
e request goes to Service Worker. |
81 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS); | 81 m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS); |
82 m_resourceRequest.setFetchCredentialsMode(useCredentials ? WebURLRequest::Fe
tchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); | 82 m_resourceRequest.setFetchCredentialsMode(useCredentials ? WebURLRequest::Fe
tchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); |
83 | 83 |
84 m_options.allowCredentials = (isSameOriginRequest || useCredentials) ? Allow
StoredCredentials : DoNotAllowStoredCredentials; | 84 m_options.allowCredentials = (isSameOriginRequest || useCredentials) ? Allow
StoredCredentials : DoNotAllowStoredCredentials; |
85 m_options.corsEnabled = IsCORSEnabled; | 85 m_options.corsEnabled = IsCORSEnabled; |
86 m_options.securityOrigin = origin; | 86 m_options.securityOrigin = origin; |
(...skipping 19 matching lines...) Expand all Loading... |
106 | 106 |
107 void FetchRequest::makeSynchronous() | 107 void FetchRequest::makeSynchronous() |
108 { | 108 { |
109 // Synchronous requests should always be max priority, lest they hang the re
nderer. | 109 // Synchronous requests should always be max priority, lest they hang the re
nderer. |
110 m_resourceRequest.setPriority(ResourceLoadPriorityHighest); | 110 m_resourceRequest.setPriority(ResourceLoadPriorityHighest); |
111 m_resourceRequest.setTimeoutInterval(10); | 111 m_resourceRequest.setTimeoutInterval(10); |
112 m_options.synchronousPolicy = RequestSynchronously; | 112 m_options.synchronousPolicy = RequestSynchronously; |
113 } | 113 } |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
OLD | NEW |