crosswalk-project/crosswalk — pull request #1475 by jeez (2014-01-14 14:55:23+00:00)
Title: [Extensions] Make extension namespace read-only

Extensions export their JS content under their namespace,
which is created with the extension name. That means an
extension called "xwalk.sample" will export its functions
below the "xwalk.sample" object in JS.
This patch avoids that one do things like "xwalk.sample = null",
by marking the extension namespace object as read-only whenever
an extension's code was loaded.

We don't touch entry_points (changing their properties to read-only)
because this is something the extension writer should do him/herself
when writing the JS shim, by JS means, since we can't predict
which entry_points should be marked as read-only or not.
In other words, that is part of the extension API being implemented.

BUG=https://crosswalk-project.org/jira/browse/XWALK-605
BUG=https://crosswalk-project.org/jira/browse/XWALK-600
TEST=./out/Release/xwalk_extensions_browsertest --gtest_filter="NamespaceReadOnlyExtensionTest.*"
TEST= Also covered by TCT in the "_in_tizen" tests.