But there is comment near ReloadSharedInstance that "all string access is expected to happen on the UI thread". So my question is why it is expected? If it is really expected, we should enforce it by inserting DCHECK that current thread is UI thread. But I see no reason for doing this.
Having thread-safe load resources is significant advantage
Resources reload happens only on Chrome OS during OOBE/login when there is no browser windows so it is exception case when it is safe.
In general if we make some assumption, we should add check otherwise it will be broken at some point.
I think documenting the expected behavior of this code (whatever it is
-- UI thread only or thread-safe) in the form of assertions like the
one you added is always a good idea.
On Fri, Apr 8, 2011 at 2:07 AM, Dmitry Polukhin <dpol...@chromium.org> wrote:
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>