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

Side by Side Diff: content/child/websocket_message_filter.cc

Issue 2000113002: Delegate WebSocket message handlers to the loading task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on yhirano's review Created 4 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/child/websocket_message_filter.h ('k') | content/content_child.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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) {
21 if (!WebSocketDispatcher::CanHandleMessage(message))
22 return false;
23 // |websocket_dispatcher_| is owned by a RenderThreadImpl and lives when the
24 // renderer process lives.
25 loading_task_runner_->PostTask(FROM_HERE, base::Bind(
26 base::IgnoreResult(&WebSocketDispatcher::OnMessageReceived),
27 base::Unretained(websocket_dispatcher_),
kinuko 2016/05/26 08:15:35 I might be just too nervouse, but I'm not fully ha
hajimehoshi 2016/05/26 09:49:02 Done.
28 message));
29 return true;
30 }
31
32 } // namespace content
OLDNEW
« no previous file with comments | « content/child/websocket_message_filter.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698