Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/child/websocket_message_filter.h" | |
| 6 | |
| 7 #include "base/bind.h" | |
| 8 #include "base/single_thread_task_runner.h" | |
| 9 #include "content/child/websocket_dispatcher.h" | |
| 10 #include "ipc/ipc_message.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 WebSocketMessageFilter::WebSocketMessageFilter( | |
| 15 WebSocketDispatcher* websocket_dispatcher) | |
| 16 : websocket_dispatcher_(websocket_dispatcher) {} | |
| 17 | |
| 18 WebSocketMessageFilter::~WebSocketMessageFilter() {} | |
| 19 | |
| 20 bool WebSocketMessageFilter::OnMessageReceived(const IPC::Message& message) { | |
|
yhirano
2016/05/25 10:39:52
Does this function run on the IO thread? If so, ca
yhirano
2016/05/25 11:34:52
Hmm, it seems there is no easy way to check that.
| |
| 21 if (!websocket_dispatcher_->CanHandleMessage(message)) | |
| 22 return false; | |
| 23 loading_task_runner_->PostTask(FROM_HERE, base::Bind( | |
| 24 base::IgnoreResult(&WebSocketDispatcher::OnMessageReceived), | |
| 25 base::Unretained(websocket_dispatcher_), | |
|
kinuko
2016/05/25 09:30:53
It's not obvious who guarantees websocket_dispatch
hajimehoshi
2016/05/25 12:05:02
IIUC websocket_dispatcher_ is owned by a RenderThr
| |
| 26 message)); | |
| 27 return true; | |
| 28 } | |
| 29 | |
| 30 } // namespace content | |
| OLD | NEW |