Closed Bug 618533 Opened 13 years ago Closed 13 years ago

forward oom notifications to child content process

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fennec 2.0b4+ ---

People

(Reporter: dougt, Assigned: dougt)

References

Details

Attachments

(1 file, 1 obsolete file)

when we run low on memory, we want to let the child content process know about it.  We already have a FlushMemory method on nsIMemory which has an associated observer topic.  We should forward that.
Attached patch patch v.1 (obsolete) — Splinter Review
Attachment #497036 - Flags: review?(jones.chris.g)
tracking-fennec: --- → 2.0b4+
Comment on attachment 497036 [details] [diff] [review]
patch v.1

You're missing any actual sending of the message.  Add an observer in ContentParent?
Attachment #497036 - Flags: review?(jones.chris.g) → review-
yeah, patch queue fail.  when i get back, i'll figure it out
Attached patch patch v.2Splinter Review
merge == better.
Attachment #497036 - Attachment is obsolete: true
Attachment #497091 - Flags: review?(josh)
Attachment #497091 - Flags: review?(josh) → review+
Comment on attachment 497091 [details] [diff] [review]
patch v.2

>diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
>--- a/dom/ipc/ContentChild.cpp
>+++ b/dom/ipc/ContentChild.cpp
>@@ -581,10 +581,20 @@ ContentChild::RecvScreenSizeChanged(cons
> #ifdef ANDROID
>     mScreenSize = size;
> #else
>     NS_RUNTIMEABORT("Message currently only expected on android");
> #endif
>   return true;
> }
> 
>+bool
>+ContentChild::RecvFlushMemory(const nsString& reason)
>+{
>+    nsCOMPtr<nsIObserverService> os =
>+        mozilla::services::GetObserverService();
>+    if (os)
>+	os->NotifyObservers(nsnull, "memory-pressure", reason.get());

This is a tab. Please fix.

>+  return true;
>+}
>+
> } // namespace dom
> } // namespace mozilla
oh, i missed it when i pushed

http://hg.mozilla.org/mozilla-central/rev/888d64457836

but a new ws-removal patch is in my queue.  I will push it next time I push something else.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
err.. wrong link.

the ws change was http://hg.mozilla.org/mozilla-central/rev/d4456ada0374
Depends on: 639867
You need to log in before you can comment on or make changes to this bug.