| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/edk/system/master_connection_manager.h" | 5 #include "mojo/edk/system/master_connection_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 bytes)); | 191 bytes)); |
| 192 | 192 |
| 193 if (result == Result::SUCCESS_CONNECT_NEW_CONNECTION) { | 193 if (result == Result::SUCCESS_CONNECT_NEW_CONNECTION) { |
| 194 DCHECK_EQ(message_view.subtype(), | 194 DCHECK_EQ(message_view.subtype(), |
| 195 MessageInTransit::Subtype::CONNECTION_MANAGER_CONNECT); | 195 MessageInTransit::Subtype::CONNECTION_MANAGER_CONNECT); |
| 196 DCHECK(platform_handle.is_valid()); | 196 DCHECK(platform_handle.is_valid()); |
| 197 embedder::ScopedPlatformHandleVectorPtr platform_handles( | 197 embedder::ScopedPlatformHandleVectorPtr platform_handles( |
| 198 new embedder::PlatformHandleVector()); | 198 new embedder::PlatformHandleVector()); |
| 199 platform_handles->push_back(platform_handle.release()); | 199 platform_handles->push_back(platform_handle.release()); |
| 200 response->SetTransportData(util::MakeUnique<TransportData>( | 200 response->SetTransportData(util::MakeUnique<TransportData>( |
| 201 platform_handles.Pass(), | 201 std::move(platform_handles), |
| 202 raw_channel_->GetSerializedPlatformHandleSize())); | 202 raw_channel_->GetSerializedPlatformHandleSize())); |
| 203 } else { | 203 } else { |
| 204 DCHECK(!platform_handle.is_valid()); | 204 DCHECK(!platform_handle.is_valid()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 if (!raw_channel_->WriteMessage(std::move(response))) { | 207 if (!raw_channel_->WriteMessage(std::move(response))) { |
| 208 LOG(ERROR) << "WriteMessage failed"; | 208 LOG(ERROR) << "WriteMessage failed"; |
| 209 FatalError(); // WARNING: This destroys us. | 209 FatalError(); // WARNING: This destroys us. |
| 210 return; | 210 return; |
| 211 } | 211 } |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 } | 737 } |
| 738 | 738 |
| 739 void MasterConnectionManager::AssertOnPrivateThread() const { | 739 void MasterConnectionManager::AssertOnPrivateThread() const { |
| 740 // This should only be called after |Init()| and before |Shutdown()|. | 740 // This should only be called after |Init()| and before |Shutdown()|. |
| 741 DCHECK(private_thread_.message_loop()); | 741 DCHECK(private_thread_.message_loop()); |
| 742 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop()); | 742 DCHECK_EQ(base::MessageLoop::current(), private_thread_.message_loop()); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace system | 745 } // namespace system |
| 746 } // namespace mojo | 746 } // namespace mojo |
| OLD | NEW |