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: remoting/protocol/channel_multiplexer.cc

Issue 394883008: Add basic perf tests for chromoting protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « remoting/proto/video.proto ('k') | remoting/protocol/connection_to_host.h » ('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 #include "remoting/protocol/channel_multiplexer.h" 5 #include "remoting/protocol/channel_multiplexer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 void ChannelMultiplexer::NotifyWriteFailed(const std::string& name) { 476 void ChannelMultiplexer::NotifyWriteFailed(const std::string& name) {
477 std::map<std::string, MuxChannel*>::iterator it = channels_.find(name); 477 std::map<std::string, MuxChannel*>::iterator it = channels_.find(name);
478 if (it != channels_.end()) { 478 if (it != channels_.end()) {
479 it->second->OnWriteFailed(); 479 it->second->OnWriteFailed();
480 } 480 }
481 } 481 }
482 482
483 void ChannelMultiplexer::OnIncomingPacket(scoped_ptr<MultiplexPacket> packet, 483 void ChannelMultiplexer::OnIncomingPacket(scoped_ptr<MultiplexPacket> packet,
484 const base::Closure& done_task) { 484 const base::Closure& done_task) {
485 DCHECK(packet->has_channel_id());
485 if (!packet->has_channel_id()) { 486 if (!packet->has_channel_id()) {
486 LOG(ERROR) << "Received packet without channel_id."; 487 LOG(ERROR) << "Received packet without channel_id.";
487 done_task.Run(); 488 done_task.Run();
488 return; 489 return;
489 } 490 }
490 491
491 int receive_id = packet->channel_id(); 492 int receive_id = packet->channel_id();
492 MuxChannel* channel = NULL; 493 MuxChannel* channel = NULL;
493 std::map<int, MuxChannel*>::iterator it = 494 std::map<int, MuxChannel*>::iterator it =
494 channels_by_receive_id_.find(receive_id); 495 channels_by_receive_id_.find(receive_id);
(...skipping 15 matching lines...) Expand all
510 channel->OnIncomingPacket(packet.Pass(), done_task); 511 channel->OnIncomingPacket(packet.Pass(), done_task);
511 } 512 }
512 513
513 bool ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet, 514 bool ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet,
514 const base::Closure& done_task) { 515 const base::Closure& done_task) {
515 return writer_.Write(SerializeAndFrameMessage(*packet), done_task); 516 return writer_.Write(SerializeAndFrameMessage(*packet), done_task);
516 } 517 }
517 518
518 } // namespace protocol 519 } // namespace protocol
519 } // namespace remoting 520 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/proto/video.proto ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698