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

Side by Side Diff: content/browser/message_port_service.h

Issue 737833002: Properly queue messages sent to message ports that are transferred to a service worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cross_process_messaging_with_terminate
Patch Set: better cleanup in case of errors Created 6 years, 1 month 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.cc ('k') | content/browser/message_port_service.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 #ifndef CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_ 5 #ifndef CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_
6 #define CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_ 6 #define CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 19 matching lines...) Expand all
30 MessagePortMessageFilter* filter, 30 MessagePortMessageFilter* filter,
31 int* message_port_id); 31 int* message_port_id);
32 void Destroy(int message_port_id); 32 void Destroy(int message_port_id);
33 void Entangle(int local_message_port_id, int remote_message_port_id); 33 void Entangle(int local_message_port_id, int remote_message_port_id);
34 void PostMessage(int sender_message_port_id, 34 void PostMessage(int sender_message_port_id,
35 const base::string16& message, 35 const base::string16& message,
36 const std::vector<int>& sent_message_port_ids); 36 const std::vector<int>& sent_message_port_ids);
37 void QueueMessages(int message_port_id); 37 void QueueMessages(int message_port_id);
38 void SendQueuedMessages(int message_port_id, 38 void SendQueuedMessages(int message_port_id,
39 const QueuedMessages& queued_messages); 39 const QueuedMessages& queued_messages);
40 void ReleaseMessages(int message_port_id);
40 41
41 // Updates the information needed to reach a message port when it's sent to a 42 // Updates the information needed to reach a message port when it's sent to a
42 // (possibly different) process. 43 // (possibly different) process.
43 void UpdateMessagePort( 44 void UpdateMessagePort(
44 int message_port_id, 45 int message_port_id,
45 MessagePortMessageFilter* filter, 46 MessagePortMessageFilter* filter,
46 int routing_id); 47 int routing_id);
47 48
49 // The message port is being transferred to a new renderer process, but the
50 // code doing isn't able to immediately update the message port with a new
falken 2014/11/20 03:42:43 "code doing that"?
Marijn Kruisselbrink 2014/11/20 22:14:43 Done.
51 // filter and routing_id. This queues up all messages sent to this port until
52 // later ReleaseMessages is called for this port. If ultimately transfering
53 // the port to a new process fails, ClosePost should be called to clean up the
54 // port.
55 void HoldMessages(int message_port_id);
56
57 // Closes and cleans up the message port.
58 void ClosePort(int message_port_id);
59
48 void OnMessagePortMessageFilterClosing(MessagePortMessageFilter* filter); 60 void OnMessagePortMessageFilterClosing(MessagePortMessageFilter* filter);
49 61
50 // Attempts to send the queued messages for a message port. 62 // Attempts to send the queued messages for a message port.
51 void SendQueuedMessagesIfPossible(int message_port_id); 63 void SendQueuedMessagesIfPossible(int message_port_id);
52 64
53 private: 65 private:
54 friend struct DefaultSingletonTraits<MessagePortService>; 66 friend struct DefaultSingletonTraits<MessagePortService>;
55 67
56 MessagePortService(); 68 MessagePortService();
57 ~MessagePortService(); 69 ~MessagePortService();
(...skipping 12 matching lines...) Expand all
70 82
71 // We need globally unique identifiers for each message port. 83 // We need globally unique identifiers for each message port.
72 int next_message_port_id_; 84 int next_message_port_id_;
73 85
74 DISALLOW_COPY_AND_ASSIGN(MessagePortService); 86 DISALLOW_COPY_AND_ASSIGN(MessagePortService);
75 }; 87 };
76 88
77 } // namespace content 89 } // namespace content
78 90
79 #endif // CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_ 91 #endif // CONTENT_BROWSER_MESSAGE_PORT_SERVICE_H_
OLDNEW
« no previous file with comments | « content/browser/message_port_message_filter.cc ('k') | content/browser/message_port_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698