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

Side by Side Diff: components/copresence/copresence_state_impl.cc

Issue 734243003: Adding the chrome://copresence page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@state
Patch Set: Created 6 years 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 | « chrome/common/url_constants.cc ('k') | tools/gritsettings/resource_ids » ('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 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 <set> 5 #include <set>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "components/copresence/copresence_state_impl.h" 9 #include "components/copresence/copresence_state_impl.h"
10 #include "components/copresence/proto/data.pb.h" 10 #include "components/copresence/proto/data.pb.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 observers_, 94 observers_,
95 TokenTransmitted(transmitted_tokens_[token.id])); 95 TokenTransmitted(transmitted_tokens_[token.id]));
96 } 96 }
97 97
98 // TODO(ckehoe): Check which tokens are no longer heard and report them lost. 98 // TODO(ckehoe): Check which tokens are no longer heard and report them lost.
99 void CopresenceStateImpl::UpdateReceivedToken(const ReceivedToken& token) { 99 void CopresenceStateImpl::UpdateReceivedToken(const ReceivedToken& token) {
100 DCHECK(!token.id.empty()); 100 DCHECK(!token.id.empty());
101 101
102 // TODO(ckehoe): Have CopresenceManagerImpl::AudioCheck() use this to check 102 // TODO(ckehoe): Have CopresenceManagerImpl::AudioCheck() use this to check
103 // if we can hear our token, and delete the logic from the AudioManager. 103 // if we can hear our token, and delete the logic from the AudioManager.
104 // TODO(ckehoe): Test that this actually works.
104 if (transmitted_tokens_.count(token.id) > 0) { 105 if (transmitted_tokens_.count(token.id) > 0) {
105 transmitted_tokens_[token.id].broadcast_confirmed = true; 106 transmitted_tokens_[token.id].broadcast_confirmed = true;
106 FOR_EACH_OBSERVER(CopresenceObserver, 107 FOR_EACH_OBSERVER(CopresenceObserver,
107 observers_, 108 observers_,
108 TokenTransmitted(transmitted_tokens_[token.id])); 109 TokenTransmitted(transmitted_tokens_[token.id]));
109 } else { 110 } else {
110 ReceivedToken& stored_token = received_tokens_[token.id]; 111 ReceivedToken& stored_token = received_tokens_[token.id];
111 UpdateToken(token, &stored_token); 112 UpdateToken(token, &stored_token);
112 113
113 // The decoder doesn't track when this token was heard before, 114 // The decoder doesn't track when this token was heard before,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (transmitted_tokens_[token].stop_time > now) 171 if (transmitted_tokens_[token].stop_time > now)
171 transmitted_tokens_[token].stop_time = now; 172 transmitted_tokens_[token].stop_time = now;
172 173
173 FOR_EACH_OBSERVER(CopresenceObserver, 174 FOR_EACH_OBSERVER(CopresenceObserver,
174 observers_, 175 observers_,
175 TokenTransmitted(transmitted_tokens_[token])); 176 TokenTransmitted(transmitted_tokens_[token]));
176 } 177 }
177 } 178 }
178 179
179 } // namespace copresence 180 } // namespace copresence
OLDNEW
« no previous file with comments | « chrome/common/url_constants.cc ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698