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

Side by Side Diff: content/child/resource_dispatcher.cc

Issue 1107043003: [ABANDONED] Make sure that threaded-data-provider doesn't cause a use-after-free. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/child/resource_dispatcher.h" 7 #include "content/child/resource_dispatcher.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // call peer's callback. 246 // call peer's callback.
247 if (request_info->blocked_response && !alternative_data.empty()) { 247 if (request_info->blocked_response && !alternative_data.empty()) {
248 data_ptr = alternative_data.data(); 248 data_ptr = alternative_data.data();
249 data_length = alternative_data.size(); 249 data_length = alternative_data.size();
250 encoded_data_length = alternative_data.size(); 250 encoded_data_length = alternative_data.size();
251 } 251 }
252 } 252 }
253 253
254 if (!request_info->blocked_response || !alternative_data.empty()) { 254 if (!request_info->blocked_response || !alternative_data.empty()) {
255 if (request_info->threaded_data_provider) { 255 if (request_info->threaded_data_provider) {
256 DCHECK(alternative_data.empty());
256 request_info->threaded_data_provider->OnReceivedDataOnForegroundThread( 257 request_info->threaded_data_provider->OnReceivedDataOnForegroundThread(
257 data_ptr, data_length, encoded_data_length); 258 data_ptr, data_length, encoded_data_length);
258 // A threaded data provider will take care of its own ACKing, as the 259 // A threaded data provider will take care of its own ACKing, as the
259 // data may be processed later on another thread. 260 // data may be processed later on another thread.
260 send_ack = false; 261 send_ack = false;
261 } else { 262 } else {
262 request_info->peer->OnReceivedData( 263 request_info->peer->OnReceivedData(
263 data_ptr, data_length, encoded_data_length); 264 data_ptr, data_length, encoded_data_length);
264 } 265 }
265 } 266 }
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 extra_data->transferred_request_request_id(); 796 extra_data->transferred_request_request_id();
796 request->service_worker_provider_id = 797 request->service_worker_provider_id =
797 extra_data->service_worker_provider_id(); 798 extra_data->service_worker_provider_id();
798 request->request_body = request_body; 799 request->request_body = request_body;
799 if (frame_origin) 800 if (frame_origin)
800 *frame_origin = extra_data->frame_origin(); 801 *frame_origin = extra_data->frame_origin();
801 return request.Pass(); 802 return request.Pass();
802 } 803 }
803 804
804 } // namespace content 805 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698