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

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

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Initialise encoded_body_length for sync XHR to data: URLs Created 4 years, 5 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "components/nacl/renderer/histogram.h" 10 #include "components/nacl/renderer/histogram.h"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 void ManifestDownloader::didReceiveResponse( 37 void ManifestDownloader::didReceiveResponse(
38 blink::WebURLLoader* loader, 38 blink::WebURLLoader* loader,
39 const blink::WebURLResponse& response) { 39 const blink::WebURLResponse& response) {
40 if (response.httpStatusCode() != 200) 40 if (response.httpStatusCode() != 200)
41 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_LOAD_URL; 41 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_LOAD_URL;
42 status_code_ = response.httpStatusCode(); 42 status_code_ = response.httpStatusCode();
43 } 43 }
44 44
45 void ManifestDownloader::didReceiveData( 45 void ManifestDownloader::didReceiveData(blink::WebURLLoader* loader,
46 blink::WebURLLoader* loader, 46 const char* data,
47 const char* data, 47 int data_length,
48 int data_length, 48 int encoded_data_length,
49 int encoded_data_length) { 49 int encoded_body_length) {
50 if (buffer_.size() + data_length > kNaClManifestMaxFileBytes) { 50 if (buffer_.size() + data_length > kNaClManifestMaxFileBytes) {
51 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_TOO_LARGE; 51 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_TOO_LARGE;
52 buffer_.clear(); 52 buffer_.clear();
53 } 53 }
54 54
55 if (pp_nacl_error_ == PP_NACL_ERROR_LOAD_SUCCESS) 55 if (pp_nacl_error_ == PP_NACL_ERROR_LOAD_SUCCESS)
56 buffer_.append(data, data_length); 56 buffer_.append(data, data_length);
57 } 57 }
58 58
59 void ManifestDownloader::Close() { 59 void ManifestDownloader::Close() {
(...skipping 29 matching lines...) Expand all
89 } 89 }
90 } else { 90 } else {
91 // It's a WebKit error. 91 // It's a WebKit error.
92 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL; 92 pp_nacl_error_ = PP_NACL_ERROR_MANIFEST_NOACCESS_URL;
93 } 93 }
94 94
95 Close(); 95 Close();
96 } 96 }
97 97
98 } // namespace nacl 98 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/renderer/manifest_downloader.h ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698