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

Side by Side Diff: net/nqe/socket_watcher.cc

Issue 2024813003: Split SocketWatcher and SocketWatcherFactory out of NQE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
(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 "net/nqe/socket_watcher.h"
6
7 #include "base/bind.h"
8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/time/time.h"
11
12 namespace net {
13
14 namespace nqe {
15
16 namespace internal {
17
18 SocketWatcher::SocketWatcher(
19 SocketPerformanceWatcherFactory::Protocol protocol,
20 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
21 OnUpdatedRTTAvailableCallback updated_rtt_observation_callback)
22 : protocol_(protocol),
23 task_runner_(std::move(task_runner)),
24 updated_rtt_observation_callback_(updated_rtt_observation_callback) {}
25
26 SocketWatcher::~SocketWatcher() {}
27
28 bool SocketWatcher::ShouldNotifyUpdatedRTT() const {
29 DCHECK(thread_checker_.CalledOnValidThread());
30
31 return true;
32 }
33
34 void SocketWatcher::OnUpdatedRTTAvailable(const base::TimeDelta& rtt) {
35 DCHECK(thread_checker_.CalledOnValidThread());
36
37 task_runner_->PostTask(
38 FROM_HERE, base::Bind(updated_rtt_observation_callback_, protocol_, rtt));
39 }
40
41 void SocketWatcher::OnConnectionChanged() {
42 DCHECK(thread_checker_.CalledOnValidThread());
43 }
44
45 } // namespace internal
46
47 } // namespace nqe
48
49 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698