Add guards on frame().

It seems reasonable to guard against the lack of a frame,  then verify if the small number of crashes reported in
http://crbug.com/360391 go away.

BUG=360391

Review URL: https://codereview.chromium.org/227803002

git-svn-id: svn://svn.chromium.org/blink/trunk@171056 bbb929c8-8fbe-4397-9dbb-9b2b20218538