| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/message_port_service.h" | 5 #include "content/browser/message_port_service.h" |
| 6 | 6 |
| 7 #include "content/common/message_port_messages.h" | 7 #include "content/common/message_port_messages.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/message_port_delegate.h" | 9 #include "content/public/browser/message_port_delegate.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return queue_for_inflight_messages || hold_messages_for_destination; | 43 return queue_for_inflight_messages || hold_messages_for_destination; |
| 44 } | 44 } |
| 45 // If true, the message port should be destroyed but was currently still | 45 // If true, the message port should be destroyed but was currently still |
| 46 // waiting for a SendQueuedMessages message from a renderer. As soon as that | 46 // waiting for a SendQueuedMessages message from a renderer. As soon as that |
| 47 // message is received the port will actually be destroyed. | 47 // message is received the port will actually be destroyed. |
| 48 bool should_be_destroyed; | 48 bool should_be_destroyed; |
| 49 QueuedMessages queued_messages; | 49 QueuedMessages queued_messages; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 MessagePortService* MessagePortService::GetInstance() { | 52 MessagePortService* MessagePortService::GetInstance() { |
| 53 return Singleton<MessagePortService>::get(); | 53 return base::Singleton<MessagePortService>::get(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 MessagePortService::MessagePortService() | 56 MessagePortService::MessagePortService() |
| 57 : next_message_port_id_(0) { | 57 : next_message_port_id_(0) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 MessagePortService::~MessagePortService() { | 60 MessagePortService::~MessagePortService() { |
| 61 } | 61 } |
| 62 | 62 |
| 63 void MessagePortService::UpdateMessagePort(int message_port_id, | 63 void MessagePortService::UpdateMessagePort(int message_port_id, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // Do the disentanglement (and be paranoid about the other side existing | 333 // Do the disentanglement (and be paranoid about the other side existing |
| 334 // just in case something unusual happened during entanglement). | 334 // just in case something unusual happened during entanglement). |
| 335 if (message_ports_.count(entangled_id)) { | 335 if (message_ports_.count(entangled_id)) { |
| 336 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; | 336 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 message_ports_.erase(erase_item); | 339 message_ports_.erase(erase_item); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace content | 342 } // namespace content |
| OLD | NEW |