Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebKit.cpp |
| diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp |
| index 0b34d329fe1731ff74d23c781dd3704634a42e34..1e9e2820431af885fee57d2c9f2e039bf41967de 100644 |
| --- a/third_party/WebKit/Source/web/WebKit.cpp |
| +++ b/third_party/WebKit/Source/web/WebKit.cpp |
| @@ -92,10 +92,20 @@ static GCTaskRunner* s_gcTaskRunner = nullptr; |
| // Doing so may cause hard to reproduce crashes. |
| static bool s_webKitInitialized = false; |
| +static ModulesInitializer& modulesInitializer() |
| +{ |
| + DEFINE_STATIC_LOCAL(OwnPtr<ModulesInitializer>, initializer, (adoptPtr(new ModulesInitializer))); |
| + return *initializer; |
| +} |
| + |
| void initialize(Platform* platform) |
| { |
| initializeWithoutV8(platform); |
| + modulesInitializer().init(); |
| + |
| + setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); |
|
yhirano
2016/03/08 07:05:24
[optional] Can we move this function call to Modul
|
| + |
| V8Initializer::initializeMainThreadIfNeeded(); |
| OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor(V8PerIsolateData::mainThreadIsolate())); |
| @@ -141,12 +151,6 @@ static void adjustAmountOfExternalAllocatedMemory(int size) |
| v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); |
| } |
| -static ModulesInitializer& modulesInitializer() |
| -{ |
| - DEFINE_STATIC_LOCAL(OwnPtr<ModulesInitializer>, initializer, (adoptPtr(new ModulesInitializer))); |
| - return *initializer; |
| -} |
| - |
| void initializeWithoutV8(Platform* platform) |
| { |
| ASSERT(!s_webKitInitialized); |
| @@ -166,10 +170,6 @@ void initializeWithoutV8(Platform* platform) |
| ASSERT(!s_gcTaskRunner); |
| s_gcTaskRunner = new GCTaskRunner(currentThread); |
| } |
| - |
| - modulesInitializer().init(); |
| - |
| - setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); |
| } |
| void shutdown() |
| @@ -212,14 +212,14 @@ void shutdown() |
| V8PerIsolateData::destroy(isolate); |
| + modulesInitializer().shutdown(); |
| + |
| shutdownWithoutV8(); |
| } |
| void shutdownWithoutV8() |
| { |
| ASSERT(isMainThread()); |
| - modulesInitializer().shutdown(); |
| - |
| // currentThread() is null if we are running on a thread without a message loop. |
| if (Platform::current()->currentThread()) { |
| ASSERT(s_gcTaskRunner); |