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

Unified Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 591463003: Remote Assistance on Chrome OS Part III - NativeMessageHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native_messaging
Patch Set: Created 6 years, 3 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/extensions/api/messaging/message_service.cc
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index 1de7c5924e99766959de190646670e9243c0807b..e794df32c62096d9b1a5f6789e5885dbfbc7100f 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -372,9 +372,9 @@ void MessageService::OpenChannelToNativeApp(
PrefService* pref_service = profile->GetPrefs();
// Verify that the host is not blocked by policies.
- NativeMessageProcessHost::PolicyPermission policy_permission =
- NativeMessageProcessHost::IsHostAllowed(pref_service, native_app_name);
- if (policy_permission == NativeMessageProcessHost::DISALLOW) {
+ NativeMessageHost::PolicyPermission policy_permission =
+ NativeMessageHost::IsHostAllowed(pref_service, native_app_name);
+ if (policy_permission == NativeMessageHost::DISALLOW) {
DispatchOnDisconnect(source, receiver_port_id, kProhibitedByPoliciesError);
return;
}
@@ -388,22 +388,22 @@ void MessageService::OpenChannelToNativeApp(
content::RenderWidgetHost::FromID(source_process_id, source_routing_id)->
GetView()->GetNativeView();
- scoped_ptr<NativeMessageProcessHost> native_process =
- NativeMessageProcessHost::Create(
- native_view,
- base::WeakPtr<NativeMessageProcessHost::Client>(
- weak_factory_.GetWeakPtr()),
- source_extension_id, native_app_name, receiver_port_id,
- policy_permission == NativeMessageProcessHost::ALLOW_ALL);
+ scoped_ptr<NativeMessageHost> native_host = NativeMessageHost::Create(
+ native_view,
+ base::WeakPtr<NativeMessageHost::Client>(weak_factory_.GetWeakPtr()),
+ source_extension_id,
+ native_app_name,
+ receiver_port_id,
+ policy_permission == NativeMessageHost::ALLOW_ALL);
// Abandon the channel.
- if (!native_process.get()) {
+ if (!native_host.get()) {
LOG(ERROR) << "Failed to create native process.";
DispatchOnDisconnect(
source, receiver_port_id, kReceivingEndDoesntExistError);
return;
}
- channel->receiver.reset(new NativeMessagePort(native_process.release()));
+ channel->receiver.reset(new NativeMessagePort(native_host.release()));
// Keep the opener alive until the channel is closed.
channel->opener->IncrementLazyKeepaliveCount();
@@ -563,7 +563,7 @@ void MessageService::PostMessage(int source_port_id, const Message& message) {
DispatchMessage(source_port_id, iter->second, message);
}
-void MessageService::PostMessageFromNativeProcess(int port_id,
+void MessageService::PostMessageFromNative(int port_id,
const std::string& message) {
PostMessage(port_id, Message(message, false /* user_gesture */));
}

Powered by Google App Engine
This is Rietveld 408576698