Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2042)

Unified Diff: Source/web/WebKit.cpp

Issue 559363002: Switch blink to use a gin-managed isolate. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/WorkerScriptController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebKit.cpp
diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
index 370d6141528c28f16bf3a834d136dc11e9b2cf0f..9411f97e35f2895436dc35c9887cec99e90d655c 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -92,29 +92,13 @@ static ThreadState::Interruptor* s_isolateInterruptor = 0;
// Doing so may cause hard to reproduce crashes.
static bool s_webKitInitialized = false;
-static bool generateEntropy(unsigned char* buffer, size_t length)
-{
- if (Platform::current()) {
- Platform::current()->cryptographicallyRandomValues(buffer, length);
- return true;
- }
- return false;
-}
-
void initialize(Platform* platform)
{
initializeWithoutV8(platform);
- v8::V8::InitializePlatform(gin::V8Platform::Get());
- v8::Isolate* isolate = v8::Isolate::New();
- isolate->Enter();
- V8Initializer::initializeMainThreadIfNeeded(isolate);
- v8::V8::SetEntropySource(&generateEntropy);
- v8::V8::SetArrayBufferAllocator(v8ArrayBufferAllocator());
- v8::V8::Initialize();
- V8PerIsolateData::ensureInitialized(isolate);
+ V8Initializer::initializeMainThreadIfNeeded();
- s_isolateInterruptor = new V8IsolateInterruptor(v8::Isolate::GetCurrent());
+ s_isolateInterruptor = new V8IsolateInterruptor(V8PerIsolateData::mainThreadIsolate());
ThreadState::current()->addInterruptor(s_isolateInterruptor);
// currentThread will always be non-null in production, but can be null in Chromium unit tests.
@@ -224,8 +208,6 @@ void shutdown()
v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
V8PerIsolateData::dispose(isolate);
- isolate->Exit();
- isolate->Dispose();
shutdownWithoutV8();
}
« no previous file with comments | « Source/bindings/core/v8/WorkerScriptController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698