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

Side by Side Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 2769333006: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in chrome/browser (Closed)
Patch Set: Created 3 years, 9 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 | chrome/browser/predictors/resource_prefetch_predictor.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 #include "chrome/browser/extensions/api/messaging/message_service.h" 5 #include "chrome/browser/extensions/api/messaging/message_service.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 params->receiver->RemoveCommonFrames(*opener); 556 params->receiver->RemoveCommonFrames(*opener);
557 if (!params->receiver->IsValidPort()) { 557 if (!params->receiver->IsValidPort()) {
558 opener->DispatchOnDisconnect(kReceivingEndDoesntExistError); 558 opener->DispatchOnDisconnect(kReceivingEndDoesntExistError);
559 return; 559 return;
560 } 560 }
561 561
562 std::unique_ptr<MessageChannel> channel_ptr = 562 std::unique_ptr<MessageChannel> channel_ptr =
563 base::MakeUnique<MessageChannel>(); 563 base::MakeUnique<MessageChannel>();
564 MessageChannel* channel = channel_ptr.get(); 564 MessageChannel* channel = channel_ptr.get();
565 channel->opener.reset(opener.release()); 565 channel->opener = std::move(opener);
566 channel->receiver.reset(params->receiver.release()); 566 channel->receiver = std::move(params->receiver);
567 AddChannel(std::move(channel_ptr), params->receiver_port_id); 567 AddChannel(std::move(channel_ptr), params->receiver_port_id);
568 568
569 int guest_process_id = content::ChildProcessHost::kInvalidUniqueID; 569 int guest_process_id = content::ChildProcessHost::kInvalidUniqueID;
570 int guest_render_frame_routing_id = MSG_ROUTING_NONE; 570 int guest_render_frame_routing_id = MSG_ROUTING_NONE;
571 if (params->include_guest_process_info) { 571 if (params->include_guest_process_info) {
572 guest_process_id = params->source_process_id; 572 guest_process_id = params->source_process_id;
573 guest_render_frame_routing_id = params->source_routing_id; 573 guest_render_frame_routing_id = params->source_routing_id;
574 574
575 DCHECK(WebViewGuest::FromWebContents( 575 DCHECK(WebViewGuest::FromWebContents(
576 WebContents::FromRenderFrameHost(source))); 576 WebContents::FromRenderFrameHost(source)));
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 MessageChannelMap::iterator channel_iter = channels_.find(channel_id); 988 MessageChannelMap::iterator channel_iter = channels_.find(channel_id);
989 if (channel_iter != channels_.end()) { 989 if (channel_iter != channels_.end()) {
990 for (const PendingMessage& message : queue) { 990 for (const PendingMessage& message : queue) {
991 DispatchMessage(message.first, channel_iter->second.get(), 991 DispatchMessage(message.first, channel_iter->second.get(),
992 message.second); 992 message.second);
993 } 993 }
994 } 994 }
995 } 995 }
996 996
997 } // namespace extensions 997 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698