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

Side by Side Diff: content/renderer/fetchers/web_url_loader_client_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/fetchers/web_url_loader_client_impl.h" 5 #include "content/renderer/fetchers/web_url_loader_client_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebURLError.h" 8 #include "third_party/WebKit/public/platform/WebURLError.h"
9 #include "third_party/WebKit/public/platform/WebURLLoader.h" 9 #include "third_party/WebKit/public/platform/WebURLLoader.h"
10 #include "third_party/WebKit/public/platform/WebURLResponse.h" 10 #include "third_party/WebKit/public/platform/WebURLResponse.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 WebURLLoaderClientImpl::WebURLLoaderClientImpl() 14 WebURLLoaderClientImpl::WebURLLoaderClientImpl()
15 : completed_(false) 15 : completed_(false)
16 , status_(LOADING) { 16 , status_(LOADING) {
17 } 17 }
18 18
19 WebURLLoaderClientImpl::~WebURLLoaderClientImpl() { 19 WebURLLoaderClientImpl::~WebURLLoaderClientImpl() {
20 } 20 }
21 21
22 void WebURLLoaderClientImpl::didReceiveResponse( 22 void WebURLLoaderClientImpl::didReceiveResponse(
23 blink::WebURLLoader* loader, const blink::WebURLResponse& response) { 23 blink::WebURLLoader* loader, const blink::WebURLResponse& response) {
24 DCHECK(!completed_); 24 DCHECK(!completed_);
25 response_ = response; 25 response_ = response;
26 } 26 }
27 27
28 void WebURLLoaderClientImpl::didReceiveData( 28 void WebURLLoaderClientImpl::didReceiveData(blink::WebURLLoader* loader,
29 blink::WebURLLoader* loader, 29 const char* data,
30 const char* data, 30 int data_length,
31 int data_length, 31 int encoded_data_length,
32 int encoded_data_length) { 32 int encoded_body_length) {
33 // The AssociatedURLLoader will continue after a load failure. 33 // The AssociatedURLLoader will continue after a load failure.
34 // For example, for an Access Control error. 34 // For example, for an Access Control error.
35 if (completed_) 35 if (completed_)
36 return; 36 return;
37 DCHECK(data_length > 0); 37 DCHECK(data_length > 0);
38 38
39 data_.append(data, data_length); 39 data_.append(data, data_length);
40 } 40 }
41 41
42 void WebURLLoaderClientImpl::didReceiveCachedMetadata( 42 void WebURLLoaderClientImpl::didReceiveCachedMetadata(
(...skipping 30 matching lines...) Expand all
73 DCHECK(!completed_); 73 DCHECK(!completed_);
74 DCHECK(status_ == LOADING); 74 DCHECK(status_ == LOADING);
75 75
76 completed_ = true; 76 completed_ = true;
77 status_ = status; 77 status_ = status;
78 78
79 OnLoadComplete(); 79 OnLoadComplete();
80 } 80 }
81 81
82 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/fetchers/web_url_loader_client_impl.h ('k') | content/renderer/media/android/media_info_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698