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

Side by Side Diff: remoting/test/protocol_perftest.cc

Issue 1655433002: Remove done notifications from incoming message handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <utility> 5 #include <utility>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void OnSessionConfig(const protocol::SessionConfig& config) override {} 124 void OnSessionConfig(const protocol::SessionConfig& config) override {}
125 protocol::VideoStub* GetVideoStub() override { return this; } 125 protocol::VideoStub* GetVideoStub() override { return this; }
126 protocol::FrameConsumer* GetFrameConsumer() override { 126 protocol::FrameConsumer* GetFrameConsumer() override {
127 NOTREACHED(); 127 NOTREACHED();
128 return nullptr; 128 return nullptr;
129 } 129 }
130 130
131 // protocol::VideoStub interface. 131 // protocol::VideoStub interface.
132 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet, 132 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet,
133 const base::Closure& done) override { 133 const base::Closure& done) override {
134 if (video_packet->data().empty()) { 134 done.Run();
135 // Ignore keep-alive packets 135
136 done.Run(); 136 // Ignore keep-alive packets.
137 if (video_packet->data().empty())
137 return; 138 return;
138 }
139 139
140 last_video_packet_ = std::move(video_packet); 140 last_video_packet_ = std::move(video_packet);
141 141
142 if (!on_frame_task_.is_null()) 142 if (!on_frame_task_.is_null())
143 on_frame_task_.Run(); 143 on_frame_task_.Run();
144 144
145 done.Run(); 145 done.Run();
146 } 146 }
147 147
148 // HostStatusObserver interface. 148 // HostStatusObserver interface.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 << "ms Encode: " << last_video_packet_->encode_time_ms() 486 << "ms Encode: " << last_video_packet_->encode_time_ms()
487 << "ms Capture: " << last_video_packet_->capture_time_ms() 487 << "ms Capture: " << last_video_packet_->capture_time_ms()
488 << "ms"; 488 << "ms";
489 sum += latency; 489 sum += latency;
490 } 490 }
491 491
492 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); 492 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF();
493 } 493 }
494 494
495 } // namespace remoting 495 } // namespace remoting
OLDNEW
« remoting/protocol/message_reader.cc ('K') | « remoting/protocol/protobuf_message_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698