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

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

Issue 189253002: Implement ServiceWorker::postMessage() [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase fixes Created 6 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 | Annotate | Revision Log
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 15 matching lines...) Expand all
26 class WebMessagePortChannelImpl 26 class WebMessagePortChannelImpl
27 : public blink::WebMessagePortChannel, 27 : public blink::WebMessagePortChannel,
28 public IPC::Listener, 28 public IPC::Listener,
29 public base::RefCountedThreadSafe<WebMessagePortChannelImpl> { 29 public base::RefCountedThreadSafe<WebMessagePortChannelImpl> {
30 public: 30 public:
31 explicit WebMessagePortChannelImpl(base::MessageLoopProxy* child_thread_loop); 31 explicit WebMessagePortChannelImpl(base::MessageLoopProxy* child_thread_loop);
32 WebMessagePortChannelImpl(int route_id, 32 WebMessagePortChannelImpl(int route_id,
33 int message_port_id, 33 int message_port_id,
34 base::MessageLoopProxy* child_thread_loop); 34 base::MessageLoopProxy* child_thread_loop);
35 35
36 static void ExtractMessagePortIDs(blink::WebMessagePortChannelArray* channels,
37 std::vector<int>* message_port_ids);
38
36 // Queues received and incoming messages until there are no more in-flight 39 // Queues received and incoming messages until there are no more in-flight
37 // messages, then sends all of them to the browser process. 40 // messages, then sends all of them to the browser process.
38 void QueueMessages(); 41 void QueueMessages();
39 int message_port_id() const { return message_port_id_; } 42 int message_port_id() const { return message_port_id_; }
40 43
41 private: 44 private:
42 friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>; 45 friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>;
43 virtual ~WebMessagePortChannelImpl(); 46 virtual ~WebMessagePortChannelImpl();
44 47
45 // WebMessagePortChannel implementation. 48 // WebMessagePortChannel implementation.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 int route_id_; // The routing id for this object. 85 int route_id_; // The routing id for this object.
83 int message_port_id_; // A globally unique identifier for this message port. 86 int message_port_id_; // A globally unique identifier for this message port.
84 scoped_refptr<base::MessageLoopProxy> child_thread_loop_; 87 scoped_refptr<base::MessageLoopProxy> child_thread_loop_;
85 88
86 DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl); 89 DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl);
87 }; 90 };
88 91
89 } // namespace content 92 } // namespace content
90 93
91 #endif // CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_ 94 #endif // CONTENT_CHILD_WEBMESSAGEPORTCHANNEL_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698