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

Side by Side Diff: components/nacl/renderer/manifest_downloader.cc

Issue 288773002: Pepper: Simplify manifest download logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/nacl/renderer/manifest_downloader.h ('k') | components/nacl/renderer/nexe_load_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698