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

Side by Side Diff: content/browser/message_port_message_filter.cc

Issue 921013002: Optionally have MessagePort pass data as base::Value, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-move-v8-value-converter
Patch Set: Update singly-included comment Created 5 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 | « content/browser/message_port_message_filter.h ('k') | content/browser/message_port_provider.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 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 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void MessagePortMessageFilter::OnDestruct() const { 55 void MessagePortMessageFilter::OnDestruct() const {
56 BrowserThread::DeleteOnIOThread::Destruct(this); 56 BrowserThread::DeleteOnIOThread::Destruct(this);
57 } 57 }
58 58
59 int MessagePortMessageFilter::GetNextRoutingID() { 59 int MessagePortMessageFilter::GetNextRoutingID() {
60 return next_routing_id_.Run(); 60 return next_routing_id_.Run();
61 } 61 }
62 62
63 void MessagePortMessageFilter::SendMessage( 63 void MessagePortMessageFilter::SendMessage(
64 int route_id, 64 int route_id,
65 const base::string16& message, 65 const MessagePortMessage& message,
66 const std::vector<int>& sent_message_port_ids) { 66 const std::vector<int>& sent_message_port_ids) {
67 // Generate new routing ids for all ports that were sent around. This avoids 67 // Generate new routing ids for all ports that were sent around. This avoids
68 // waiting for the created ports to send a sync message back to get routing 68 // waiting for the created ports to send a sync message back to get routing
69 // ids. 69 // ids.
70 std::vector<int> new_routing_ids; 70 std::vector<int> new_routing_ids;
71 UpdateMessagePortsWithNewRoutes(sent_message_port_ids, &new_routing_ids); 71 UpdateMessagePortsWithNewRoutes(sent_message_port_ids, &new_routing_ids);
72 Send(new MessagePortMsg_Message(route_id, message, sent_message_port_ids, 72 Send(new MessagePortMsg_Message(route_id, message, sent_message_port_ids,
73 new_routing_ids)); 73 new_routing_ids));
74 } 74 }
75 75
(...skipping 27 matching lines...) Expand all
103 } 103 }
104 104
105 105
106 void MessagePortMessageFilter::OnCreateMessagePort(int *route_id, 106 void MessagePortMessageFilter::OnCreateMessagePort(int *route_id,
107 int* message_port_id) { 107 int* message_port_id) {
108 *route_id = next_routing_id_.Run(); 108 *route_id = next_routing_id_.Run();
109 MessagePortService::GetInstance()->Create(*route_id, this, message_port_id); 109 MessagePortService::GetInstance()->Create(*route_id, this, message_port_id);
110 } 110 }
111 111
112 } // namespace content 112 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/message_port_message_filter.h ('k') | content/browser/message_port_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698