Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / WebKit.cpp
index 188b902..20d46b1 100644 (file)
@@ -76,11 +76,9 @@ public:
 } // namespace
 
 static WebThread::TaskObserver* s_endOfTaskRunner = 0;
-#if ENABLE(OILPAN)
 static WebThread::TaskObserver* s_pendingGCRunner = 0;
 static WebCore::ThreadState::Interruptor* s_messageLoopInterruptor = 0;
 static WebCore::ThreadState::Interruptor* s_isolateInterruptor = 0;
-#endif
 
 // Make sure we are not re-initialized in the same address space.
 // Doing so may cause hard to reproduce crashes.
@@ -111,13 +109,10 @@ void initialize(Platform* platform)
     v8::V8::SetEntropySource(&generateEntropy);
     v8::V8::SetArrayBufferAllocator(WebCore::v8ArrayBufferAllocator());
     v8::V8::Initialize();
-    WebCore::setMainThreadIsolate(isolate);
     WebCore::V8PerIsolateData::ensureInitialized(isolate);
 
-#if ENABLE(OILPAN)
     s_isolateInterruptor = new WebCore::V8IsolateInterruptor(v8::Isolate::GetCurrent());
     WebCore::ThreadState::current()->addInterruptor(s_isolateInterruptor);
-#endif
 
     // currentThread will always be non-null in production, but can be null in Chromium unit tests.
     if (WebThread* currentThread = platform->currentThread()) {
@@ -132,7 +127,7 @@ void initialize(Platform* platform)
 
 v8::Isolate* mainThreadIsolate()
 {
-    return WebCore::mainThreadIsolate();
+    return WebCore::V8PerIsolateData::mainThreadIsolate();
 }
 
 static double currentTimeFunction()
@@ -166,7 +161,6 @@ void initializeWithoutV8(Platform* platform)
     WTF::setRandomSource(cryptographicallyRandomValues);
     WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction);
     WTF::initializeMainThread(callOnMainThreadFunction);
-#if ENABLE(OILPAN)
     WebCore::Heap::init();
     if (WebThread* currentThread = platform->currentThread()) {
         ASSERT(!s_pendingGCRunner);
@@ -177,7 +171,6 @@ void initializeWithoutV8(Platform* platform)
         s_messageLoopInterruptor = new WebCore::MessageLoopInterruptor(currentThread);
         WebCore::ThreadState::current()->addInterruptor(s_messageLoopInterruptor);
     }
-#endif
     WebCore::init();
     WebCore::ImageDecodingStore::initializeOnce();
 
@@ -208,13 +201,10 @@ void shutdown()
         s_endOfTaskRunner = 0;
     }
 
-#if ENABLE(OILPAN)
     ASSERT(s_isolateInterruptor);
     WebCore::ThreadState::current()->removeInterruptor(s_isolateInterruptor);
-#endif
 
-    WebCore::V8PerIsolateData::dispose(WebCore::mainThreadIsolate());
-    WebCore::setMainThreadIsolate(0);
+    WebCore::V8PerIsolateData::dispose(WebCore::V8PerIsolateData::mainThreadIsolate());
     v8::V8::Dispose();
 
     shutdownWithoutV8();
@@ -225,7 +215,6 @@ void shutdownWithoutV8()
     ASSERT(!s_endOfTaskRunner);
     WebCore::ImageDecodingStore::shutdown();
     WebCore::shutdown();
-#if ENABLE(OILPAN)
     if (Platform::current()->currentThread()) {
         ASSERT(s_pendingGCRunner);
         delete s_pendingGCRunner;
@@ -237,7 +226,6 @@ void shutdownWithoutV8()
         s_messageLoopInterruptor = 0;
     }
     WebCore::Heap::shutdown();
-#endif
     WTF::shutdown();
     Platform::shutdown();
     WebPrerenderingSupport::shutdown();