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

Unified Diff: remoting/host/it2me/it2me_native_messaging_host.h

Issue 2867223003: Send a message to the client if bad It2Me policies are read. (Closed)
Patch Set: Fix race. Created 3 years, 7 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
« no previous file with comments | « no previous file | remoting/host/it2me/it2me_native_messaging_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host.h
diff --git a/remoting/host/it2me/it2me_native_messaging_host.h b/remoting/host/it2me/it2me_native_messaging_host.h
index 948c41a8c004e04db398e1f473f0228227f17cf4..28ca6cdc84883d2b581cec76c9068e179bc57471 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.h
+++ b/remoting/host/it2me/it2me_native_messaging_host.h
@@ -56,6 +56,10 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
void OnStateChanged(It2MeHostState state,
const std::string& error_message) override;
+ // Set a callback to be called when a policy error notification has been
+ // processed.
+ void SetPolicyErrorClosureForTesting(const base::Closure& closure);
+
static std::string HostStateToString(It2MeHostState host_state);
private:
@@ -72,6 +76,7 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
std::unique_ptr<base::DictionaryValue> response);
void SendErrorAndExit(std::unique_ptr<base::DictionaryValue> response,
const std::string& description) const;
+ void SendPolicyErrorAndExit() const;
void SendMessageToClient(std::unique_ptr<base::Value> message) const;
// Callback for DelegatingSignalStrategy.
@@ -80,6 +85,9 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
// Called when initial policies are read and when they change.
void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies);
+ // Called when malformed policies are detected.
+ void OnPolicyError();
+
// Returns whether the request was successfully sent to the elevated host.
bool DelegateToElevatedHost(std::unique_ptr<base::DictionaryValue> message);
@@ -125,6 +133,8 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
// variable contains the thunk if it is necessary.
base::Closure pending_connect_;
+ base::Closure policy_error_closure_for_testing_;
+
base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_;
base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_;
« no previous file with comments | « no previous file | remoting/host/it2me/it2me_native_messaging_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698