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

Issue 12389041: Require manifests for native messaging hosts. (Closed)

Created:
7 years, 9 months ago by Sergey Ulanov
Modified:
7 years, 9 months ago
Reviewers:
Nico, Matt Perry
CC:
chromium-reviews, Aaron Boodman, sail+watch_chromium.org, chromium-apps-reviews_chromium.org
Visibility:
Public.

Description

Require manifests for native messaging hosts. Previously native messaging hosts were discovered by looking in the user data directory. That approach is hard to use and is not reliable. Now chrome will look for a host manifest file in a system-specific directory and load that file to find host binary. This is a second attempt to land this CL as it was reverted (see https://codereview.chromium.org/12386018). The problem that caused it to be reverted was not related to this CL. BUG=142915 TBR=mpcomplete@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=185382

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+581 lines, -47 lines) Patch
M chrome/browser/extensions/api/messaging/message_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/messaging/native_message_process_host.h View 4 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_message_process_host.cc View 6 chunks +15 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc View 5 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_messaging_apitest.cc View 1 chunk +46 lines, -7 lines 0 comments Download
A chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h View 1 chunk +62 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc View 1 chunk +138 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/messaging/native_messaging_host_manifest_unittest.cc View 1 chunk +127 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_process_launcher.h View 2 chunks +21 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_process_launcher.cc View 6 chunks +77 lines, -19 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc View 1 chunk +23 lines, -0 lines 3 comments Download
M chrome/browser/extensions/api/messaging/native_process_launcher_win.cc View 1 chunk +45 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/examples/extensions/native_messaging/popup.js View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/native_messaging/manifest.json View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/native_messaging/test.js View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Sergey Ulanov
7 years, 9 months ago (2013-03-01 00:15:19 UTC) #1
Sergey Ulanov
Committed patchset #1 manually as r185382 (presubmit successful).
7 years, 9 months ago (2013-03-01 00:16:48 UTC) #2
Matt Perry
rubber-stamp LGTM
7 years, 9 months ago (2013-03-01 00:17:20 UTC) #3
Nico
https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc File chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc (right): https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc#newcode19 chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc:19: #if defined(OS_MAXOSX) OS_MAXOSX should be OS_MACOSX (note C instead ...
7 years, 9 months ago (2013-03-20 04:04:27 UTC) #4
Sergey Ulanov
https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc File chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc (right): https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc#newcode19 chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc:19: #if defined(OS_MAXOSX) On 2013/03/20 04:04:27, Nico wrote: > OS_MAXOSX ...
7 years, 9 months ago (2013-03-20 04:25:15 UTC) #5
Nico
7 years, 9 months ago (2013-03-20 04:42:50 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api...
File chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
(right):

https://codereview.chromium.org/12389041/diff/1/chrome/browser/extensions/api...
chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc:19: #if
defined(OS_MAXOSX)
On 2013/03/20 04:25:15, sergeyu wrote:
> On 2013/03/20 04:04:27, Nico wrote:
> > OS_MAXOSX should be OS_MACOSX (note C instead of X). I'm fixing this in
> > https://codereview.chromium.org/12566038 ; shout if that's wrong.
> 
> Thanks for catching and fixing it!
> 
> > 
> > (…but: /Library/Chrome is almost certainly the wrong place for anything. We
do
> > keep some chrome stuff in /Library/Google, but only admins can write to
that.
> 
> We actually do want this directory to be writable by admin only. Do you think
I
> should change this path to /Library/Google/Chrome/NativeMessagingHosts ?

Sounds good. The master prefs file is right in /Library/Google, but other stuff
seems to be scoped by product, so /Library/Google/Chrome is probably good. Not
sure if unbranded builds should use /Library/Chromium instead.

Let mark@chromium.org review your CL, he'll probably have an opinion on this.

> 
> > Normally you'd put stuff in a subdir of
chrome::GetDefaultUserDataDirectory(),
> > which expands to ~/Library/Application Support/(Google/Chrome|Chromium).
> Please
> > take a look at changing this directory.)
> 
> This directory contains native messaging hosts that are installed per-system
and
> installation should require admin permissions. User data directory is a wrong
> place for it. 
>

Powered by Google App Engine
This is Rietveld 408576698