Closed
Bug 809888
Opened 12 years ago
Closed 11 years ago
Create IPC thread for workers
Categories
(Core :: DOM: Workers, defect)
Core
DOM: Workers
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: janv, Assigned: janv)
References
Details
Attachments
(1 file, 11 obsolete files)
54.70 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•12 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Comment 2•12 years ago
|
||
We would like to reuse the existing IndexedDBParent implementation for sync IDB in workers. However, the event loop in workers can't handle IPC messages. A special shared IPC thread should be easier to implement, since it doesn't require fundamental changes in workers implementation.
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #685593 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Comment 4•12 years ago
|
||
Assignee | ||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
Ok, so it seems that IPDL just works in this case too.
With the last patch, we are able to run this JS in workers:
var factory = new IDBFactorySync();
var db = factory.open("foo");
db.transaction("test", function(trans) {
var store = trans.objectStore("test");
var name = store.get(1);
});
Anyway, there's no handling of JS objects rooting in the patch yet.
Ben, we need your feedback here, if the implementation design is ok then Vendo can start implementing other sync IDB API methods and objects.
Assignee | ||
Comment 7•12 years ago
|
||
rebased patch
Attachment #685593 -
Attachment is obsolete: true
Attachment #685593 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Updated•12 years ago
|
Attachment #686942 -
Flags: feedback?(bent.mozilla)
Comment on attachment 685593 [details] [diff] [review]
initial design
Review of attachment 685593 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/indexedDB/ipc/PIndexedDB.ipdl
@@ +14,5 @@
> namespace indexedDB {
>
> protocol PIndexedDB
> {
> + manager PBrowser or PContent or PWorker or PWorkers;
Just PWorker.
::: dom/ipc/PWorkers.ipdl
@@ +9,5 @@
> +
> +namespace mozilla {
> +namespace dom {
> +
> +rpc protocol PWorkers
I don't think we should have any sync (or rpc) messages in our worker protocols. The sync stuff should be handled in the worker through the use of sync queues.
Also, this should be something like PWorkerManagement or something.
@@ +17,5 @@
> +
> +parent:
> + async PWorker();
> +
> + PIndexedDB();
PIndexedDB should only be created from PWorker, not here.
::: dom/ipc/WorkerParent.h
@@ +15,5 @@
> +class WorkerParent : public PWorkerParent,
> + public nsISupports
> +{
> +public:
> + NS_DECL_ISUPPORTS
This doesn't really need to be nsISupports, you just want refcounting, right? NS_INLINE_DECL_REFCOUNTING
::: dom/webidl/DOMStringList_workers.webidl
@@ +11,5 @@
> + */
> +
> +interface DOMStringList_workers {
> + readonly attribute unsigned long length;
> + // XXXvarga getters seem to be not supported in workers
Let's make sure we have a bug filed on this.
::: dom/webidl/IDBFactorySync.webidl
@@ +5,5 @@
> + *
> + * The origin of this IDL file is http://www.w3.org/TR/IndexedDB/
> + */
> +
> +[Constructor]
The factory object should just exist at global scope, you shouldn't need to call 'new IDBFactorySync()'.
::: dom/workers/IDBObjectSync.h
@@ +23,5 @@
> +
> +class IndexedDBRequestWorkerChildBase;
> +class WorkerPrivate;
> +
> +class IDBObjectProxy
I don't really understand the purpose of this class or its derived classes. Why do we need an additional proxy object for each DOM object?
::: dom/workers/RuntimeService.cpp
@@ +1070,5 @@
> }
>
> + mWorkersParent = new WorkersParent();
> + mIPCThread = new Thread("WorkersIPCThread");
> + mIPCThread->Start();
How does this thread stop?
::: dom/workers/WorkerScope.cpp
@@ +988,5 @@
> }
>
> // Init other paris-bindings.
> if (!FileReaderSyncBinding_workers::GetConstructorObject(aCx, global) ||
> + !IDBFactorySyncBinding_workers::GetProtoObject(aCx, global) ||
You need to add the rest of these here, I think.
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #679685 -
Attachment is obsolete: true
Attachment #686942 -
Attachment is obsolete: true
Attachment #686942 -
Flags: feedback?(bent.mozilla)
Attachment #703400 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Comment 10•12 years ago
|
||
Comment on attachment 703400 [details] [diff] [review]
Cleaned up patch (addressed most of the comments)
I have a new patch with alternative approach to release ipc thread objects.
Attachment #703400 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Comment 11•12 years ago
|
||
Attachment #685594 -
Attachment is obsolete: true
Attachment #685596 -
Attachment is obsolete: true
Attachment #703400 -
Attachment is obsolete: true
Attachment #704669 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Comment 12•12 years ago
|
||
I extracted IDB parts into a standalone patch which will be attached to bug 798875. So this patch only contains the IPC thread and PWorkerModule/PWorker protocols.
Assignee: nobody → Jan.Varga
Attachment #704669 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #704669 -
Flags: feedback?(bent.mozilla)
Attachment #705273 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 13•12 years ago
|
||
Attachment #705273 -
Attachment is obsolete: true
Attachment #705273 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 14•12 years ago
|
||
patch for review
Attachment #735580 -
Attachment is obsolete: true
Attachment #772085 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #772085 -
Attachment is obsolete: true
Attachment #772085 -
Flags: review?(bent.mozilla)
Attachment #827513 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 16•11 years ago
|
||
This one builds on windows.
Attachment #827513 -
Attachment is obsolete: true
Attachment #827513 -
Flags: review?(bent.mozilla)
Attachment #829383 -
Flags: review?(bent.mozilla)
Comment 17•11 years ago
|
||
Is the need for this obviated by PBackground (bug 956218)?
Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Andrew Overholt [:overholt] from comment #17)
> Is the need for this obviated by PBackground (bug 956218)?
Well, we'll see once IndexedDB on PBackground is implemented.
Can we close this bug? Workers are running the IPC event loop.
Flags: needinfo?(bent.mozilla)
Assignee | ||
Comment 20•11 years ago
|
||
Yeah, it seems it would be better to update sync IDB to use all the new stuff (new event loop and PBackground) once it's ready, the extra IPC thread would make sense in case we don't have resources to update sync IDB implementation IMO.
I'm inclined to agree.
Flags: needinfo?(bent.mozilla)
Assignee | ||
Comment 22•11 years ago
|
||
Ok
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Assignee | ||
Updated•11 years ago
|
Attachment #829383 -
Flags: review?(bent.mozilla)
You need to log in
before you can comment on or make changes to this bug.
Description
•