Commit 47c7235f authored by erg's avatar erg Committed by Commit bot

html_viewer: check reserved network addresses.

This just copies the content/ implementation.

BUG=none

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

Cr-Commit-Position: refs/heads/master@{#322646}
parent aa503001
......@@ -17,6 +17,7 @@
#include "net/base/data_url.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "third_party/WebKit/public/platform/WebWaitableEvent.h"
namespace html_viewer {
......@@ -209,6 +210,14 @@ blink::WebURLError BlinkPlatformImpl::cancelledError(const blink::WebURL& url)
return error;
}
bool BlinkPlatformImpl::isReservedIPAddress(
const blink::WebString& host) const {
net::IPAddressNumber address;
if (!net::ParseURLHostnameToNumber(host.utf8(), &address))
return false;
return net::IsIPAddressReserved(address);
}
blink::WebThread* BlinkPlatformImpl::createThread(const char* name) {
return new WebThreadImpl(name);
}
......
......@@ -46,6 +46,7 @@ class BlinkPlatformImpl : public blink::Platform {
const blink::WebURL& url, blink::WebString& mime_type,
blink::WebString& charset);
virtual blink::WebURLError cancelledError(const blink::WebURL& url) const;
virtual bool isReservedIPAddress(const blink::WebString& host) const;
virtual blink::WebThread* createThread(const char* name);
virtual blink::WebThread* currentThread();
virtual void yieldCurrentThread();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment