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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 DCHECK(load_manager); | 1461 DCHECK(load_manager); |
1462 if (!load_manager) { | 1462 if (!load_manager) { |
1463 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1463 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1464 FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), | 1464 FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), |
1465 kInvalidNaClFileInfo)); | 1465 kInvalidNaClFileInfo)); |
1466 return; | 1466 return; |
1467 } | 1467 } |
1468 | 1468 |
1469 // Handle special PNaCl support files which are installed on the user's | 1469 // Handle special PNaCl support files which are installed on the user's |
1470 // machine. | 1470 // machine. |
1471 if (url.find(kPNaClTranslatorBaseUrl, 0) == 0) { | 1471 if (base::StartsWith(url, kPNaClTranslatorBaseUrl, |
| 1472 base::CompareCase::SENSITIVE)) { |
1472 PP_NaClFileInfo file_info = kInvalidNaClFileInfo; | 1473 PP_NaClFileInfo file_info = kInvalidNaClFileInfo; |
1473 PP_FileHandle handle = GetReadonlyPnaclFd(url.c_str(), | 1474 PP_FileHandle handle = GetReadonlyPnaclFd(url.c_str(), |
1474 false /* is_executable */, | 1475 false /* is_executable */, |
1475 &file_info.token_lo, | 1476 &file_info.token_lo, |
1476 &file_info.token_hi); | 1477 &file_info.token_hi); |
1477 if (handle == PP_kInvalidFileHandle) { | 1478 if (handle == PP_kInvalidFileHandle) { |
1478 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1479 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1479 FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), | 1480 FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), |
1480 kInvalidNaClFileInfo)); | 1481 kInvalidNaClFileInfo)); |
1481 return; | 1482 return; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 // Mark the request as requesting a PNaCl bitcode file, | 1743 // Mark the request as requesting a PNaCl bitcode file, |
1743 // so that component updater can detect this user action. | 1744 // so that component updater can detect this user action. |
1744 url_request.addHTTPHeaderField( | 1745 url_request.addHTTPHeaderField( |
1745 blink::WebString::fromUTF8("Accept"), | 1746 blink::WebString::fromUTF8("Accept"), |
1746 blink::WebString::fromUTF8("application/x-pnacl, */*")); | 1747 blink::WebString::fromUTF8("application/x-pnacl, */*")); |
1747 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); | 1748 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); |
1748 downloader->Load(url_request); | 1749 downloader->Load(url_request); |
1749 } | 1750 } |
1750 | 1751 |
1751 } // namespace nacl | 1752 } // namespace nacl |
OLD | NEW |