| 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_message_filter.h" | 5 #include "content/browser/message_port_message_filter.h" |
| 6 | 6 |
| 7 #include "content/browser/message_port_service.h" | 7 #include "content/browser/message_port_service.h" |
| 8 #include "content/common/message_port_messages.h" | 8 #include "content/common/message_port_messages.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 MessagePortMessageFilter::MessagePortMessageFilter( | 12 MessagePortMessageFilter::MessagePortMessageFilter( |
| 13 const NextRoutingIDCallback& callback) | 13 const NextRoutingIDCallback& callback) |
| 14 : BrowserMessageFilter(MessagePortMsgStart), | 14 : next_routing_id_(callback) { |
| 15 next_routing_id_(callback) { | |
| 16 } | 15 } |
| 17 | 16 |
| 18 MessagePortMessageFilter::~MessagePortMessageFilter() { | 17 MessagePortMessageFilter::~MessagePortMessageFilter() { |
| 19 } | 18 } |
| 20 | 19 |
| 21 void MessagePortMessageFilter::OnChannelClosing() { | 20 void MessagePortMessageFilter::OnChannelClosing() { |
| 22 MessagePortService::GetInstance()->OnMessagePortMessageFilterClosing(this); | 21 MessagePortService::GetInstance()->OnMessagePortMessageFilterClosing(this); |
| 23 } | 22 } |
| 24 | 23 |
| 25 bool MessagePortMessageFilter::OnMessageReceived(const IPC::Message& message, | 24 bool MessagePortMessageFilter::OnMessageReceived(const IPC::Message& message, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return next_routing_id_.Run(); | 56 return next_routing_id_.Run(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 void MessagePortMessageFilter::OnCreateMessagePort(int *route_id, | 59 void MessagePortMessageFilter::OnCreateMessagePort(int *route_id, |
| 61 int* message_port_id) { | 60 int* message_port_id) { |
| 62 *route_id = next_routing_id_.Run(); | 61 *route_id = next_routing_id_.Run(); |
| 63 MessagePortService::GetInstance()->Create(*route_id, this, message_port_id); | 62 MessagePortService::GetInstance()->Create(*route_id, this, message_port_id); |
| 64 } | 63 } |
| 65 | 64 |
| 66 } // namespace content | 65 } // namespace content |
| OLD | NEW |