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

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

Issue 14522010: remoting: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 8 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
« no previous file with comments | « remoting/client/plugin/pepper_port_allocator.cc ('k') | remoting/host/chromoting_host.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pepper_token_fetcher.h" 5 #include "remoting/client/plugin/pepper_token_fetcher.h"
6 6
7 #include "remoting/client/plugin/chromoting_instance.h" 7 #include "remoting/client/plugin/chromoting_instance.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
11 PepperTokenFetcher::PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin, 11 PepperTokenFetcher::PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin,
12 const std::string& host_public_key) 12 const std::string& host_public_key)
13 : plugin_(plugin), 13 : plugin_(plugin),
14 host_public_key_(host_public_key), 14 host_public_key_(host_public_key),
15 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 15 weak_factory_(this) {
16 } 16 }
17 17
18 PepperTokenFetcher::~PepperTokenFetcher() { 18 PepperTokenFetcher::~PepperTokenFetcher() {
19 } 19 }
20 20
21 void PepperTokenFetcher::FetchThirdPartyToken( 21 void PepperTokenFetcher::FetchThirdPartyToken(
22 const GURL& token_url, 22 const GURL& token_url,
23 const std::string& scope, 23 const std::string& scope,
24 const TokenFetchedCallback& token_fetched_callback) { 24 const TokenFetchedCallback& token_fetched_callback) {
25 if (plugin_) { 25 if (plugin_) {
26 token_fetched_callback_ = token_fetched_callback; 26 token_fetched_callback_ = token_fetched_callback;
27 plugin_->FetchThirdPartyToken(token_url, host_public_key_, scope, 27 plugin_->FetchThirdPartyToken(token_url, host_public_key_, scope,
28 weak_factory_.GetWeakPtr()); 28 weak_factory_.GetWeakPtr());
29 } 29 }
30 } 30 }
31 31
32 void PepperTokenFetcher::OnTokenFetched( 32 void PepperTokenFetcher::OnTokenFetched(
33 const std::string& token, const std::string& shared_secret) { 33 const std::string& token, const std::string& shared_secret) {
34 if (!token_fetched_callback_.is_null()) { 34 if (!token_fetched_callback_.is_null()) {
35 token_fetched_callback_.Run(token, shared_secret); 35 token_fetched_callback_.Run(token, shared_secret);
36 token_fetched_callback_.Reset(); 36 token_fetched_callback_.Reset();
37 } 37 }
38 } 38 }
39 39
40 } // namespace remoting 40 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_port_allocator.cc ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698