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

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

Issue 453793002: Add audible support to the copresence API. (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
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 "components/copresence/public/copresence_client.h" 5 #include "components/copresence/public/copresence_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/copresence/public/copresence_client_delegate.h" 8 #include "components/copresence/public/copresence_client_delegate.h"
9 #include "components/copresence/public/whispernet_client.h" 9 #include "components/copresence/public/whispernet_client.h"
10 #include "components/copresence/rpc/rpc_handler.h" 10 #include "components/copresence/rpc/rpc_handler.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // Public methods 23 // Public methods
24 24
25 CopresenceClient::CopresenceClient(CopresenceClientDelegate* delegate) 25 CopresenceClient::CopresenceClient(CopresenceClientDelegate* delegate)
26 : delegate_(delegate), init_failed_(false), pending_init_operations_(0) { 26 : delegate_(delegate), init_failed_(false), pending_init_operations_(0) {
27 DVLOG(3) << "Initializing client."; 27 DVLOG(3) << "Initializing client.";
28 pending_init_operations_++; 28 pending_init_operations_++;
29 rpc_handler_.reset(new RpcHandler(delegate)); 29 rpc_handler_.reset(new RpcHandler(delegate));
30 // We own the RpcHandler, so it won't outlive us. 30 // We own the RpcHandler, so it won't outlive us.
31 rpc_handler_->Initialize(base::Bind(&CopresenceClient::InitStepComplete, 31 rpc_handler_->Initialize(base::Bind(&CopresenceClient::InitStepComplete,
32 base::Unretained(this), 32 AsWeakPtr(),
Charlie 2014/08/08 22:24:14 Huh?
rkc 2014/08/09 06:58:54 Will go away with the rebase once you land the RPC
33 "Copresence device registration")); 33 "Copresence device registration"));
34 34
35 pending_init_operations_++; 35 pending_init_operations_++;
36 delegate_->GetWhispernetClient()->Initialize( 36 delegate_->GetWhispernetClient()->Initialize(
37 base::Bind(&CopresenceClient::InitStepComplete, 37 base::Bind(&CopresenceClient::InitStepComplete,
38 // The WhispernetClient must discard this on Shutdown. 38 // The WhispernetClient must discard this on Shutdown.
39 base::Unretained(this), 39 base::Unretained(this),
40 "Whispernet proxy initialization")); 40 "Whispernet proxy initialization"));
41 } 41 }
42 42
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 LOG(ERROR) << step << " failed!"; 95 LOG(ERROR) << step << " failed!";
96 init_failed_ = true; 96 init_failed_ = true;
97 } 97 }
98 98
99 DVLOG(3) << "Init step: " << step << " complete."; 99 DVLOG(3) << "Init step: " << step << " complete.";
100 pending_init_operations_--; 100 pending_init_operations_--;
101 CompleteInitialization(); 101 CompleteInitialization();
102 } 102 }
103 103
104 } // namespace copresence 104 } // namespace copresence
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698