cefsharp/CefSharp — pull request #536 by sylvain-hamel (2014-10-28 16:53:40+00:00)
Title: Fix: js bindings must be kept by browser, not by process

When `renderer-process-limit` is set to a low value (1) and multiple browser instances are used, all browser instances end up using the same JS binding object (the last one registered).

The root cause is that the binding is kept per process (`CefAppUnmanagedWrapper`) instead of per browser instance (`CefBrowserWrapper`).

The fix is to move the bindings from `CefAppUnmanagedWrapper` to `CefBrowserWrapper` class. I deleted the `Bind` method because it was no longer used.

---

According to [this comment](https://code.google.com/p/chromium/codesearch#chromium/src/content/public/common/content_switches.cc&q=kRendererProcessLimit&sq=package:chromium&type=cs&l=710) the number of processes is a calculated value.

On our PCs we always get one process per browser instance if we use the defaut value for `renderer-process-limit`. Each process consumes at least 20 MB. Because our app may open up to 20 browser instances, we've decided to set `renderer-process-limit` to 5 to limit the memory consumed by our app.

We think this bug may occur even if you don't change `renderer-process-limit` because at some point, the number of browser instances can probably exceed the *calculated limit to the number of renderer processes*.