OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/manifest_downloader.h" | 5 #include "components/nacl/renderer/manifest_downloader.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "components/nacl/renderer/histogram.h" | 8 #include "components/nacl/renderer/histogram.h" |
9 #include "components/nacl/renderer/nexe_load_manager.h" | 9 #include "components/nacl/renderer/nexe_load_manager.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "third_party/WebKit/public/platform/WebURLError.h" | 11 #include "third_party/WebKit/public/platform/WebURLError.h" |
12 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 12 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
13 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 13 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
14 | 14 |
15 namespace nacl { | 15 namespace nacl { |
16 | 16 |
17 namespace { | |
18 // This is a pretty arbitrary limit on the byte size of the NaCl manifest file. | |
19 // Note that the resulting string object has to have at least one byte extra | |
20 // for the null termination character. | |
21 const size_t kNaClManifestMaxFileBytes = 1024 * 1024; | |
22 } // namespace | |
23 | |
24 ManifestDownloader::ManifestDownloader( | 17 ManifestDownloader::ManifestDownloader( |
25 bool is_installed, | 18 bool is_installed, |
26 ManifestDownloaderCallback cb) | 19 ManifestDownloaderCallback cb) |
27 : is_installed_(is_installed), | 20 : is_installed_(is_installed), |
28 cb_(cb), | 21 cb_(cb), |
29 status_code_(-1), | 22 status_code_(-1), |
30 pp_nacl_error_(PP_NACL_ERROR_LOAD_SUCCESS) { | 23 pp_nacl_error_(PP_NACL_ERROR_LOAD_SUCCESS) { |
31 CHECK(!cb.is_null()); | 24 CHECK(!cb.is_null()); |
32 } | 25 } |
33 | 26 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL; | 76 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL; |
84 break; | 77 break; |
85 } | 78 } |
86 } else { | 79 } else { |
87 // It's a WebKit error. | 80 // It's a WebKit error. |
88 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL; | 81 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL; |
89 } | 82 } |
90 } | 83 } |
91 | 84 |
92 } // namespace nacl | 85 } // namespace nacl |
OLD | NEW |