OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/support/test_webmessageportchannel.h" | 5 #include "webkit/support/test_webmessageportchannel.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/task.h" | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel
Client.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel
Client.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
13 | 12 |
14 using WebKit::WebMessagePortChannel; | 13 using WebKit::WebMessagePortChannel; |
15 using WebKit::WebMessagePortChannelArray; | 14 using WebKit::WebMessagePortChannelArray; |
16 using WebKit::WebMessagePortChannelClient; | 15 using WebKit::WebMessagePortChannelClient; |
17 using WebKit::WebString; | 16 using WebKit::WebString; |
18 | 17 |
19 class TestWebMessagePortChannel::Message { | 18 class TestWebMessagePortChannel::Message { |
20 public: | 19 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ports.swap(*message_ports); | 81 ports.swap(*message_ports); |
83 return true; | 82 return true; |
84 } | 83 } |
85 | 84 |
86 void TestWebMessagePortChannel::queueMessage(Message* message) { | 85 void TestWebMessagePortChannel::queueMessage(Message* message) { |
87 bool was_empty = message_queue_.empty(); | 86 bool was_empty = message_queue_.empty(); |
88 message_queue_.push(message); | 87 message_queue_.push(message); |
89 if (client_ && was_empty) | 88 if (client_ && was_empty) |
90 client_->messageAvailable(); | 89 client_->messageAvailable(); |
91 } | 90 } |
OLD | NEW |