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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 15927028: Update remoting/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 476 }
477 477
478 void ChromotingInstance::FetchThirdPartyToken( 478 void ChromotingInstance::FetchThirdPartyToken(
479 const GURL& token_url, 479 const GURL& token_url,
480 const std::string& host_public_key, 480 const std::string& host_public_key,
481 const std::string& scope, 481 const std::string& scope,
482 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher) { 482 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher) {
483 // Once the Session object calls this function, it won't continue the 483 // Once the Session object calls this function, it won't continue the
484 // authentication until the callback is called (or connection is canceled). 484 // authentication until the callback is called (or connection is canceled).
485 // So, it's impossible to reach this with a callback already registered. 485 // So, it's impossible to reach this with a callback already registered.
486 DCHECK(!pepper_token_fetcher_); 486 DCHECK(!pepper_token_fetcher_.get());
487 pepper_token_fetcher_ = pepper_token_fetcher; 487 pepper_token_fetcher_ = pepper_token_fetcher;
488 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 488 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
489 data->SetString("tokenUrl", token_url.spec()); 489 data->SetString("tokenUrl", token_url.spec());
490 data->SetString("hostPublicKey", host_public_key); 490 data->SetString("hostPublicKey", host_public_key);
491 data->SetString("scope", scope); 491 data->SetString("scope", scope);
492 PostChromotingMessage("fetchThirdPartyToken", data.Pass()); 492 PostChromotingMessage("fetchThirdPartyToken", data.Pass());
493 } 493 }
494 494
495 void ChromotingInstance::OnConnectionReady(bool ready) { 495 void ChromotingInstance::OnConnectionReady(bool ready) {
496 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 496 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 secret_fetched_callback_.Run(pin); 764 secret_fetched_callback_.Run(pin);
765 secret_fetched_callback_.Reset(); 765 secret_fetched_callback_.Reset();
766 } else { 766 } else {
767 LOG(WARNING) << "Ignored OnPinFetched received without a pending fetch."; 767 LOG(WARNING) << "Ignored OnPinFetched received without a pending fetch.";
768 } 768 }
769 } 769 }
770 770
771 void ChromotingInstance::OnThirdPartyTokenFetched( 771 void ChromotingInstance::OnThirdPartyTokenFetched(
772 const std::string& token, 772 const std::string& token,
773 const std::string& shared_secret) { 773 const std::string& shared_secret) {
774 if (pepper_token_fetcher_) { 774 if (pepper_token_fetcher_.get()) {
775 pepper_token_fetcher_->OnTokenFetched(token, shared_secret); 775 pepper_token_fetcher_->OnTokenFetched(token, shared_secret);
776 pepper_token_fetcher_.reset(); 776 pepper_token_fetcher_.reset();
777 } else { 777 } else {
778 LOG(WARNING) << "Ignored OnThirdPartyTokenFetched without a pending fetch."; 778 LOG(WARNING) << "Ignored OnThirdPartyTokenFetched without a pending fetch.";
779 } 779 }
780 } 780 }
781 781
782 ChromotingStats* ChromotingInstance::GetStats() { 782 ChromotingStats* ChromotingInstance::GetStats() {
783 if (!client_.get()) 783 if (!client_.get())
784 return NULL; 784 return NULL;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 url_components.scheme.len); 948 url_components.scheme.len);
949 return url_scheme == kChromeExtensionUrlScheme; 949 return url_scheme == kChromeExtensionUrlScheme;
950 } 950 }
951 951
952 bool ChromotingInstance::IsConnected() { 952 bool ChromotingInstance::IsConnected() {
953 return host_connection_.get() && 953 return host_connection_.get() &&
954 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 954 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
955 } 955 }
956 956
957 } // namespace remoting 957 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698