Index: content/utility/utility_thread_impl.cc |
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc |
index 00ebc6e6b908b9c63126dd899d618a6f469fd6e0..9e5e33ea574fab8764282a8965cfc305e705a03f 100644 |
--- a/content/utility/utility_thread_impl.cc |
+++ b/content/utility/utility_thread_impl.cc |
@@ -55,8 +55,8 @@ UtilityThreadImpl::~UtilityThreadImpl() { |
void UtilityThreadImpl::Shutdown() { |
ChildThreadImpl::Shutdown(); |
- if (!IsInBrowserProcess()) |
- blink::shutdown(); |
+ if (blink_platform_impl_) |
+ blink::shutdownWithoutV8(); |
} |
void UtilityThreadImpl::ReleaseProcessIfNeeded() { |
@@ -74,17 +74,22 @@ void UtilityThreadImpl::ReleaseProcessIfNeeded() { |
} |
} |
-void UtilityThreadImpl::Init() { |
- batch_mode_ = false; |
- ChildProcess::current()->AddRefProcess(); |
- if (!IsInBrowserProcess()) { |
+void UtilityThreadImpl::EnsureBlinkInitialized() { |
+ if (blink_platform_impl_ || IsInBrowserProcess()) { |
// We can only initialize WebKit on one thread, and in single process mode |
// we run the utility thread on separate thread. This means that if any code |
// needs WebKit initialized in the utility process, they need to have |
// another path to support single process mode. |
- blink_platform_impl_.reset(new UtilityBlinkPlatformImpl); |
- blink::initialize(blink_platform_impl_.get()); |
+ return; |
} |
+ |
+ blink_platform_impl_.reset(new UtilityBlinkPlatformImpl); |
+ blink::initializeWithoutV8(blink_platform_impl_.get()); |
+} |
+ |
+void UtilityThreadImpl::Init() { |
+ batch_mode_ = false; |
+ ChildProcess::current()->AddRefProcess(); |
GetContentClient()->utility()->UtilityThreadStarted(); |
process_control_.reset(new UtilityProcessControlImpl); |