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

Unified Diff: chrome/browser/local_discovery/wifi/credential_getter_win.h

Issue 343053002: Credential passing for WifiManager in Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/wifi/credential_getter_win.h
diff --git a/chrome/browser/local_discovery/wifi/credential_getter_win.h b/chrome/browser/local_discovery/wifi/credential_getter_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..94d6cf5f7c50fbf9da93a0a97989c1e21e05e564
--- /dev/null
+++ b/chrome/browser/local_discovery/wifi/credential_getter_win.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_
+#define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_
+
+#include "base/message_loop/message_loop_proxy.h"
+#include "content/public/browser/utility_process_host.h"
+#include "content/public/browser/utility_process_host_client.h"
+
+namespace local_discovery {
+namespace wifi {
+
+class CredentialGetterWin : public content::UtilityProcessHostClient {
+ public:
+ typedef base::Callback<void(bool success, const std::string& key)>
+ CredentialsCallback;
+
+ CredentialGetterWin();
+ virtual ~CredentialGetterWin();
+
+ void StartGetCredentials(const std::string& network_guid,
+ const CredentialsCallback& callback);
+
+ // Used in cases where base::MessageLoopProxy::current() does not exist.
+ void SetCallbackRunner(
+ 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>&
+
+ private:
+ // UtilityProcessHostClient
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnProcessCrashed(int exit_code) OVERRIDE;
+ virtual void OnProcessLaunchFailed() OVERRIDE;
+
+ // IPC message handlers.
+ void OnGotCredentials(const std::string& key_data, bool success);
+
+ void StartOnIOThread(const std::string& network_guid);
+
+ void PostCallback(bool success, const std::string& key_data);
+
+ CredentialsCallback callback_;
+ 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.
+};
+
+} // namespace wifi
+} // namespace local_discovery
+
+#endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698