SVGImage: check requestCount() to check all subresources are loaded

Document::loadEventFinished() was used to check all subresources of SVG are
loaded in RELEASE_ASSERT() added by
https://chromiumcodereview.appspot.com/22999031.
However, it is sufficient to check that ResourceFetcher::requestCount() is
zero and we don't have to wait load event completion of the SVG document.

This CL changes the RELEASE_ASSERT() to check ResourceFetcher::requestCount().

Also, this CL checks the assertion in ImageLoader::notifyFinished(), because
currentFrameHasSingleSecurityOrigin() can be called anytime after
|ImageLoader::m_imageComplete| is set to true in notifyFinished() and thus
the assertion must hold at that point.

This is preparation for https://codereview.chromium.org/1475863005/, which
will invoke SVG Document's load event async and thus the load event completion
can be after SVGImage::currentFrameHasSingleSecurityOrigin() is called.

BUG=569511

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

Cr-Commit-Position: refs/heads/master@{#365164}
3 files changed