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

Side by Side Diff: content/child/webmessageportchannel_impl.h

Issue 1110103003: Initial implementation of stashed message ports, content side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nicer dchecks Created 5 years, 7 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/storage_partition_impl.cc ('k') | content/child/webmessageportchannel_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_ 5 #ifndef CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_
6 #define CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_ 6 #define CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const std::vector<TransferredMessagePort>& message_ports, 62 const std::vector<TransferredMessagePort>& message_ports,
63 const std::vector<int>& new_routing_ids, 63 const std::vector<int>& new_routing_ids,
64 const scoped_refptr<base::SingleThreadTaskRunner>& 64 const scoped_refptr<base::SingleThreadTaskRunner>&
65 main_thread_task_runner); 65 main_thread_task_runner);
66 66
67 // Queues received and incoming messages until there are no more in-flight 67 // Queues received and incoming messages until there are no more in-flight
68 // messages, then sends all of them to the browser process. 68 // messages, then sends all of them to the browser process.
69 void QueueMessages(); 69 void QueueMessages();
70 int message_port_id() const { return message_port_id_; } 70 int message_port_id() const { return message_port_id_; }
71 71
72 void set_is_stashed() { is_stashed_ = true; }
73
72 private: 74 private:
73 friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>; 75 friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>;
74 ~WebMessagePortChannelImpl() override; 76 ~WebMessagePortChannelImpl() override;
75 77
76 // WebMessagePortChannel implementation. 78 // WebMessagePortChannel implementation.
77 virtual void setClient(blink::WebMessagePortChannelClient* client); 79 virtual void setClient(blink::WebMessagePortChannelClient* client);
78 virtual void destroy(); 80 virtual void destroy();
79 virtual void postMessage(const blink::WebString& message, 81 virtual void postMessage(const blink::WebString& message,
80 blink::WebMessagePortChannelArray* channels); 82 blink::WebMessagePortChannelArray* channels);
81 virtual bool tryGetMessage(blink::WebString* message, 83 virtual bool tryGetMessage(blink::WebString* message,
(...skipping 26 matching lines...) Expand all
108 110
109 blink::WebMessagePortChannelClient* client_; 111 blink::WebMessagePortChannelClient* client_;
110 base::Lock lock_; // Locks access to above. 112 base::Lock lock_; // Locks access to above.
111 113
112 int route_id_; // The routing id for this object. 114 int route_id_; // The routing id for this object.
113 int message_port_id_; // A globally unique identifier for this message port. 115 int message_port_id_; // A globally unique identifier for this message port.
114 // Flag to indicate if messages should be sent to the browser process as 116 // Flag to indicate if messages should be sent to the browser process as
115 // base::Value instances as opposed to being serialized using the default 117 // base::Value instances as opposed to being serialized using the default
116 // blink::WebSerializedScriptValue. 118 // blink::WebSerializedScriptValue.
117 bool send_messages_as_values_; 119 bool send_messages_as_values_;
120 bool is_stashed_;
118 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 121 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
119 122
120 DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl); 123 DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl);
121 }; 124 };
122 125
123 } // namespace content 126 } // namespace content
124 127
125 #endif // CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_ 128 #endif // CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/child/webmessageportchannel_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698