Check shared memory size before allocating it.
This will prevent overflow from multiplication.
BUG=359454
Review URL: https://codereview.chromium.org/214343006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261549 0039d316-1c4b-4281-b951-d872f2087c98