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

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

Issue 1544293002: Convert Pass()→std::move() in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « content/child/request_extra_data.h ('k') | content/child/resource_dispatcher_unittest.cc » ('j') | 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 <utility>
10
9 #include "base/bind.h" 11 #include "base/bind.h"
10 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
11 #include "base/debug/alias.h" 13 #include "base/debug/alias.h"
12 #include "base/debug/dump_without_crashing.h" 14 #include "base/debug/dump_without_crashing.h"
13 #include "base/debug/stack_trace.h" 15 #include "base/debug/stack_trace.h"
14 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
15 #include "base/memory/shared_memory.h" 17 #include "base/memory/shared_memory.h"
16 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
17 #include "base/metrics/histogram.h" 19 #include "base/metrics/histogram.h"
18 #include "base/rand_util.h" 20 #include "base/rand_util.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // A threaded data provider will take care of its own ACKing, as the data 281 // A threaded data provider will take care of its own ACKing, as the data
280 // may be processed later on another thread. 282 // may be processed later on another thread.
281 send_ack = false; 283 send_ack = false;
282 request_info->threaded_data_provider->OnReceivedDataOnForegroundThread( 284 request_info->threaded_data_provider->OnReceivedDataOnForegroundThread(
283 data_ptr, data_length, encoded_data_length); 285 data_ptr, data_length, encoded_data_length);
284 } else { 286 } else {
285 scoped_ptr<RequestPeer::ReceivedData> data = 287 scoped_ptr<RequestPeer::ReceivedData> data =
286 factory->Create(data_offset, data_length, encoded_data_length); 288 factory->Create(data_offset, data_length, encoded_data_length);
287 // |data| takes care of ACKing. 289 // |data| takes care of ACKing.
288 send_ack = false; 290 send_ack = false;
289 request_info->peer->OnReceivedData(data.Pass()); 291 request_info->peer->OnReceivedData(std::move(data));
290 } 292 }
291 293
292 UMA_HISTOGRAM_TIMES("ResourceDispatcher.OnReceivedDataTime", 294 UMA_HISTOGRAM_TIMES("ResourceDispatcher.OnReceivedDataTime",
293 base::TimeTicks::Now() - time_start); 295 base::TimeTicks::Now() - time_start);
294 } 296 }
295 297
296 // Acknowledge the reception of this data. 298 // Acknowledge the reception of this data.
297 if (send_ack) 299 if (send_ack)
298 message_sender_->Send(new ResourceHostMsg_DataReceived_ACK(request_id)); 300 message_sender_->Send(new ResourceHostMsg_DataReceived_ACK(request_id));
299 } 301 }
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 request->transferred_request_child_id = 855 request->transferred_request_child_id =
854 extra_data->transferred_request_child_id(); 856 extra_data->transferred_request_child_id();
855 request->transferred_request_request_id = 857 request->transferred_request_request_id =
856 extra_data->transferred_request_request_id(); 858 extra_data->transferred_request_request_id();
857 request->service_worker_provider_id = 859 request->service_worker_provider_id =
858 extra_data->service_worker_provider_id(); 860 extra_data->service_worker_provider_id();
859 request->lofi_state = extra_data->lofi_state(); 861 request->lofi_state = extra_data->lofi_state();
860 request->request_body = request_body; 862 request->request_body = request_body;
861 if (frame_origin) 863 if (frame_origin)
862 *frame_origin = extra_data->frame_origin(); 864 *frame_origin = extra_data->frame_origin();
863 return request.Pass(); 865 return request;
864 } 866 }
865 867
866 void ResourceDispatcher::SetResourceSchedulingFilter( 868 void ResourceDispatcher::SetResourceSchedulingFilter(
867 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { 869 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
868 resource_scheduling_filter_ = resource_scheduling_filter; 870 resource_scheduling_filter_ = resource_scheduling_filter;
869 } 871 }
870 872
871 } // namespace content 873 } // namespace content
OLDNEW
« no previous file with comments | « content/child/request_extra_data.h ('k') | content/child/resource_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698