Closed Bug 576161 Opened 15 years ago Closed 3 years ago

A ServiceCaller service can make remoting service calls much easier

Categories

(Core :: DOM: Content Processes, enhancement, P5)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: azakai, Unassigned)

Details

Attachments

(1 file)

We need to remote calls for various services (e.g. cookie service, permissions manager, etc. etc.). Instead of writing a new IPDL protocol for each, which involves several new files, changes to several others, and various opportunities for introducing bugs, we can do all of these using a single path, as follows. 1. Content process sends an IPC message, saying what service, what method, and what parameters. 2. Message is received, and a ServiceCaller JS service is called, which then calls the appropriate service for us. ("we heard you like service calls, so we put a service call in your service call") This would be able to work for any service/interface which is scriptable, whose relevant method is synchronous, and whose parameters/return value are remotable. Remoting such calls would become a matter of a few lines of non-bug-prone code. Attached is a patch for discussion purposes. It works but is not fully polished. It includes the necessary code to remote the permissions manager.
Comment on attachment 455327 [details] [diff] [review] Patch for discussion purposes Drive by Nice concept. Makes it almost as easy as using JS and MessageManager >+EXTRA_PP_COMPONENTS = \ >+ serviceCaller.js \ convention is "nsServiceCaller.js" >diff --git a/dom/ipc/nsIServiceCaller.idl b/dom/ipc/nsIServiceCaller.idl >+[scriptable, uuid(1a414df4-7d24-496c-86f3-1f5f02a2a275)] >+interface nsIServiceCaller: nsISupports >+{ >+ /** >+ */ >+ PRInt32 callInt(in ACString aContractId, in ACString aService, >+ in ACString aMethod, in AString aArguments); >+}; * Passing the arguments as a string seems awkward. Maybe just use an array? * nsIServiceCaller is a bit too vague. Doesn't tell me that this is for remoting. Anyway, like I said - nice idea!
I talked briefly with bsmedberg on irc about this. He said he was concerned about letting arbitrary services and methods be called, since the content process might be compromised. I believe this can be addressed with a whitelist, and that overall it would be a net gain for security, as we would be writing less protocol code. Need to discuss this further.
Component: IPC → DOM: Content Processes
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5

It seems that nobody missed this enough to ever do it. Should we just close this?

Type: defect → enhancement
Flags: needinfo?(bugs)

And we shouldn't have done this anyhow.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bugs)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: