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

Unified Diff: Source/web/WebKit.cpp

Issue 227653002: Hook up gin platform to blink, and explicitly manage the main thread isolate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/web/DEPS ('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 754c02d3b4a8a5ec003bdbcd31814a0add333528..47d9dbeb441b202e573731c05b4a9292683436ec 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -42,6 +42,7 @@
#include "core/page/Page.h"
#include "core/frame/Settings.h"
#include "core/workers/WorkerGlobalScopeProxy.h"
+#include "gin/public/v8_platform.h"
#include "platform/LayoutTestSupport.h"
#include "platform/Logging.h"
#include "platform/graphics/ImageDecodingStore.h"
@@ -104,7 +105,9 @@ void initialize(Platform* platform)
{
initializeWithoutV8(platform);
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::V8::InitializePlatform(gin::V8Platform::Get());
+ v8::Isolate* isolate = v8::Isolate::New();
+ isolate->Enter();
WebCore::V8Initializer::initializeMainThreadIfNeeded(isolate);
v8::V8::SetEntropySource(&generateEntropy);
v8::V8::SetArrayBufferAllocator(WebCore::v8ArrayBufferAllocator());
@@ -205,9 +208,11 @@ void shutdown()
ASSERT(s_isolateInterruptor);
WebCore::ThreadState::current()->removeInterruptor(s_isolateInterruptor);
+ v8::Isolate* isolate = WebCore::V8PerIsolateData::mainThreadIsolate();
- WebCore::V8PerIsolateData::dispose(WebCore::V8PerIsolateData::mainThreadIsolate());
- v8::V8::Dispose();
+ WebCore::V8PerIsolateData::dispose(isolate);
+ isolate->Exit();
+ isolate->Dispose();
shutdownWithoutV8();
}
« no previous file with comments | « Source/web/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698