OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_ | |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_ | |
7 | |
8 #include "base/message_loop/message_loop_proxy.h" | |
9 #include "content/public/browser/utility_process_host.h" | |
10 #include "content/public/browser/utility_process_host_client.h" | |
11 | |
12 namespace local_discovery { | |
13 namespace wifi { | |
14 | |
15 class CredentialGetterWin : public content::UtilityProcessHostClient { | |
16 public: | |
17 typedef base::Callback<void(bool success, const std::string& key)> | |
18 CredentialsCallback; | |
19 | |
20 CredentialGetterWin(); | |
21 virtual ~CredentialGetterWin(); | |
22 | |
23 void StartGetCredentials(const std::string& network_guid, | |
24 const CredentialsCallback& callback); | |
25 | |
26 // Used in cases where base::MessageLoopProxy::current() does not exist. | |
27 void SetCallbackRunner( | |
28 const scoped_refptr<base::MessageLoopProxy>& callback_runner); | |
Vitaly Buka (NO REVIEWS)
2014/06/21 00:33:39
base::TaskRunner* callback_runner
stevenjb
2014/06/23 17:12:20
Why use TaskRunner here, instead of MesageLoopProx
Vitaly Buka (NO REVIEWS)
2014/06/23 17:46:27
Usually Chrome code use TaskRunner or SequencedTas
Noam Samuel
2014/06/23 17:55:44
used const scoped_refptr<base::TaskRunner>&
| |
29 | |
30 private: | |
31 // UtilityProcessHostClient | |
32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
33 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | |
34 virtual void OnProcessLaunchFailed() OVERRIDE; | |
35 | |
36 // IPC message handlers. | |
37 void OnGotCredentials(const std::string& key_data, bool success); | |
38 | |
39 void StartOnIOThread(const std::string& network_guid); | |
40 | |
41 void PostCallback(bool success, const std::string& key_data); | |
42 | |
43 CredentialsCallback callback_; | |
44 scoped_refptr<base::MessageLoopProxy> callback_runner_; | |
Vitaly Buka (NO REVIEWS)
2014/06/21 00:33:39
scoped_refptr<base::TaskRunner>
Noam Samuel
2014/06/23 17:55:44
Done.
| |
45 }; | |
46 | |
47 } // namespace wifi | |
48 } // namespace local_discovery | |
49 | |
50 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_ | |
OLD | NEW |