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

Side by Side Diff: ipc/ipc_channel_mojo.cc

Issue 2772983002: Make sure channel-associated interface pointers are always safe to call. (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 | ipc/ipc_sync_message_filter.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 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 "ipc/ipc_channel_mojo.h" 5 #include "ipc/ipc_channel_mojo.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 const std::string& name, 472 const std::string& name,
473 const GenericAssociatedInterfaceFactory& factory) { 473 const GenericAssociatedInterfaceFactory& factory) {
474 base::AutoLock locker(associated_interface_lock_); 474 base::AutoLock locker(associated_interface_lock_);
475 auto result = associated_interfaces_.insert({ name, factory }); 475 auto result = associated_interfaces_.insert({ name, factory });
476 DCHECK(result.second); 476 DCHECK(result.second);
477 } 477 }
478 478
479 void ChannelMojo::GetGenericRemoteAssociatedInterface( 479 void ChannelMojo::GetGenericRemoteAssociatedInterface(
480 const std::string& name, 480 const std::string& name,
481 mojo::ScopedInterfaceEndpointHandle handle) { 481 mojo::ScopedInterfaceEndpointHandle handle) {
482 if (message_reader_) 482 if (message_reader_) {
483 message_reader_->GetRemoteInterface(name, std::move(handle)); 483 message_reader_->GetRemoteInterface(name, std::move(handle));
484 } else {
485 mojo::GetIsolatedInterface(std::move(handle));
Ken Rockot(use gerrit already) 2017/03/24 19:20:03 nit: I might consider documenting here why we do t
yzshen1 2017/03/25 07:18:15 Done.
486 }
484 } 487 }
485 488
486 } // namespace IPC 489 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_sync_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698