| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/nacl/renderer/ppb_nacl_private.h" | 5 #include "components/nacl/renderer/ppb_nacl_private.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // Allow CORS. | 341 // Allow CORS. |
| 342 options.crossOriginRequestPolicy = | 342 options.crossOriginRequestPolicy = |
| 343 blink::WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; | 343 blink::WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; |
| 344 } | 344 } |
| 345 return document.frame()->createAssociatedURLLoader(options); | 345 return document.frame()->createAssociatedURLLoader(options); |
| 346 } | 346 } |
| 347 | 347 |
| 348 blink::WebURLRequest CreateWebURLRequest(const blink::WebDocument& document, | 348 blink::WebURLRequest CreateWebURLRequest(const blink::WebDocument& document, |
| 349 const GURL& gurl) { | 349 const GURL& gurl) { |
| 350 blink::WebURLRequest request; | 350 blink::WebURLRequest request; |
| 351 request.initialize(); | |
| 352 request.setURL(gurl); | 351 request.setURL(gurl); |
| 353 request.setFirstPartyForCookies(document.firstPartyForCookies()); | 352 request.setFirstPartyForCookies(document.firstPartyForCookies()); |
| 354 return request; | 353 return request; |
| 355 } | 354 } |
| 356 | 355 |
| 357 int32_t FileDownloaderToPepperError(FileDownloader::Status status) { | 356 int32_t FileDownloaderToPepperError(FileDownloader::Status status) { |
| 358 switch (status) { | 357 switch (status) { |
| 359 case FileDownloader::SUCCESS: | 358 case FileDownloader::SUCCESS: |
| 360 return PP_OK; | 359 return PP_OK; |
| 361 case FileDownloader::ACCESS_DENIED: | 360 case FileDownloader::ACCESS_DENIED: |
| (...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 // Mark the request as requesting a PNaCl bitcode file, | 1742 // Mark the request as requesting a PNaCl bitcode file, |
| 1744 // so that component updater can detect this user action. | 1743 // so that component updater can detect this user action. |
| 1745 url_request.addHTTPHeaderField( | 1744 url_request.addHTTPHeaderField( |
| 1746 blink::WebString::fromUTF8("Accept"), | 1745 blink::WebString::fromUTF8("Accept"), |
| 1747 blink::WebString::fromUTF8("application/x-pnacl, */*")); | 1746 blink::WebString::fromUTF8("application/x-pnacl, */*")); |
| 1748 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); | 1747 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); |
| 1749 downloader->Load(url_request); | 1748 downloader->Load(url_request); |
| 1750 } | 1749 } |
| 1751 | 1750 |
| 1752 } // namespace nacl | 1751 } // namespace nacl |
| OLD | NEW |