提交 e000e532 编写于 作者: A Adam Barth

Remove Platform::cryptographicallyRandomValues

We can just call the base API directly.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/691483005
上级 e3d78d73
......@@ -127,8 +127,6 @@ private:
class PlatformProxy : public Platform {
public:
PlatformProxy(WebCompositorSupportMock** compositor) : m_compositor(compositor) { }
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); }
private:
WebCompositorSupportMock** m_compositor;
virtual WebCompositorSupport* compositorSupport() override { return *m_compositor; }
......
......@@ -117,7 +117,6 @@ private:
}
// These blink::Platform methods must be overriden to make a usable object.
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); }
virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName)
{
return &kAConstUnsignedCharZero;
......
......@@ -80,10 +80,6 @@ blink::WebDiscardableMemory* TestingPlatformSupport::allocateAndLockDiscardableM
return !m_config.hasDiscardableMemorySupport ? 0 : new TestingDiscardableMemory(bytes);
}
void TestingPlatformSupport::cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
}
const unsigned char* TestingPlatformSupport::getTraceCategoryEnabledFlag(const char* categoryName)
{
static const unsigned char tracingIsDisabled = 0;
......
......@@ -66,7 +66,6 @@ public:
// Platform:
virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) override;
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override;
virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) override;
private:
......
......@@ -16,7 +16,6 @@ class EmptyPlatform : public Platform {
public:
EmptyPlatform() { }
virtual ~EmptyPlatform() { }
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override { }
};
TEST(FontCache, getLastResortFallbackFont)
......
......@@ -249,9 +249,6 @@ public:
// it is recommended that the fixed point be no further in the past than the epoch.
virtual double monotonicallyIncreasingTime() { return 0; }
// WebKit clients must implement this funcion if they use cryptographic randomness.
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) = 0;
// Delayed work is driven by a shared timer.
typedef void (*SharedTimerFunction)();
virtual void setSharedTimerFiredFunction(SharedTimerFunction timerFunction) { }
......
......@@ -48,11 +48,6 @@ double PlatformImpl::monotonicallyIncreasingTime() {
static_cast<double>(base::Time::kMicrosecondsPerSecond);
}
void PlatformImpl::cryptographicallyRandomValues(unsigned char* buffer,
size_t length) {
base::RandBytes(buffer, length);
}
void PlatformImpl::setSharedTimerFiredFunction(void (*func)()) {
shared_timer_func_ = func;
}
......
......@@ -29,8 +29,6 @@ class PlatformImpl : public blink::Platform {
virtual blink::WebString defaultLocale();
virtual double currentTime();
virtual double monotonicallyIncreasingTime();
virtual void cryptographicallyRandomValues(
unsigned char* buffer, size_t length);
virtual void setSharedTimerFiredFunction(void (*func)());
virtual void setSharedTimerFireInterval(double interval_seconds);
virtual void stopSharedTimer();
......
......@@ -32,6 +32,7 @@
#include "public/web/Sky.h"
#include "base/message_loop/message_loop.h"
#include "base/rand_util.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8GCController.h"
#include "bindings/core/v8/V8Initializer.h"
......@@ -145,7 +146,7 @@ static double monotonicallyIncreasingTimeFunction()
static void cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
Platform::current()->cryptographicallyRandomValues(buffer, length);
base::RandBytes(buffer, length);
}
static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* context)
......
......@@ -76,11 +76,6 @@ double PlatformImpl::monotonicallyIncreasingTime() {
static_cast<double>(base::Time::kMicrosecondsPerSecond);
}
void PlatformImpl::cryptographicallyRandomValues(unsigned char* buffer,
size_t length) {
base::RandBytes(buffer, length);
}
void PlatformImpl::setSharedTimerFiredFunction(void (*func)()) {
shared_timer_func_ = func;
}
......
......@@ -33,8 +33,6 @@ class PlatformImpl : public blink::Platform {
virtual blink::WebString defaultLocale();
virtual double currentTime();
virtual double monotonicallyIncreasingTime();
virtual void cryptographicallyRandomValues(
unsigned char* buffer, size_t length);
virtual void setSharedTimerFiredFunction(void (*func)());
virtual void setSharedTimerFireInterval(double interval_seconds);
virtual void stopSharedTimer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册