Chromium Code Reviews| Index: Source/WebKit/chromium/src/WebKit.cpp |
| diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp |
| index 3eda4cac07ca81eb4a62ed24365ac6d66df1de93..1e4005a707e344bd4668b3532ea996a10c06937f 100644 |
| --- a/Source/WebKit/chromium/src/WebKit.cpp |
| +++ b/Source/WebKit/chromium/src/WebKit.cpp |
| @@ -49,6 +49,8 @@ |
| #include "core/platform/graphics/chromium/MediaPlayerPrivateChromium.h" |
| #include "core/workers/WorkerContextProxy.h" |
| #include "wtf/Assertions.h" |
| +#include "wtf/CryptographicallyRandomNumber.h" |
| +#include "wtf/CurrentTime.h" |
| #include "wtf/MainThread.h" |
| #include "wtf/Threading.h" |
| #include "wtf/UnusedParam.h" |
| @@ -116,6 +118,26 @@ void initialize(Platform* platform) |
| } |
| } |
| +static double currentTimeFunction() |
| +{ |
| + return Platform::current()->currentTime(); |
| +} |
| + |
| +static double monotonicallyIncreasingTimeFunction() |
| +{ |
| + return Platform::current()->monotonicallyIncreasingTime(); |
| +} |
| + |
| +static void cryptographicallyRandomValues(unsigned char* buffer, size_t length) |
| +{ |
| + Platform::current()->cryptographicallyRandomValues(buffer, length); |
| +} |
| + |
| +static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* context) |
| +{ |
| + Platform::current()->callOnMainThread(function, context); |
| +} |
| + |
| void initializeWithoutV8(Platform* platform) |
| { |
| ASSERT(!s_webKitInitialized); |
| @@ -124,8 +146,11 @@ void initializeWithoutV8(Platform* platform) |
| ASSERT(platform); |
| Platform::initialize(platform); |
| + WTF::setCurrentTimeFunction(currentTimeFunction); |
| + WTF::setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction); |
| + WTF::setRandomSource(cryptographicallyRandomValues); |
|
jamesr
2013/05/25 20:11:39
these have to be set before WTF::initializeThreadi
darin (slow to review)
2013/05/25 21:42:43
Would it make sense for these to become parameters
jamesr
2013/05/26 01:09:10
I've hidden the time setters into a WTF::initializ
|
| WTF::initializeThreading(); |
| - WTF::initializeMainThread(); |
| + WTF::initializeMainThread(callOnMainThreadFunction); |
|
jamesr
2013/05/25 20:11:39
callOnMainThread is something we should probably r
darin (slow to review)
2013/05/25 21:42:43
+1
|
| WebCore::init(); |
| WebCore::ImageDecodingStore::initializeOnce(); |