| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/utility/utility_thread_impl.h" | 5 #include "content/utility/utility_thread_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ChildProcess::current()->AddRefProcess(); | 78 ChildProcess::current()->AddRefProcess(); |
| 79 if (!single_process_) { | 79 if (!single_process_) { |
| 80 // We can only initialize WebKit on one thread, and in single process mode | 80 // We can only initialize WebKit on one thread, and in single process mode |
| 81 // we run the utility thread on separate thread. This means that if any code | 81 // we run the utility thread on separate thread. This means that if any code |
| 82 // needs WebKit initialized in the utility process, they need to have | 82 // needs WebKit initialized in the utility process, they need to have |
| 83 // another path to support single process mode. | 83 // another path to support single process mode. |
| 84 blink_platform_impl_.reset(new BlinkPlatformImpl); | 84 blink_platform_impl_.reset(new BlinkPlatformImpl); |
| 85 blink::initialize(blink_platform_impl_.get()); | 85 blink::initialize(blink_platform_impl_.get()); |
| 86 } | 86 } |
| 87 GetContentClient()->utility()->UtilityThreadStarted(); | 87 GetContentClient()->utility()->UtilityThreadStarted(); |
| 88 GetContentClient()->utility()->RegisterMojoServices(service_registry()); |
| 88 } | 89 } |
| 89 | 90 |
| 90 bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { | 91 bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { |
| 91 if (GetContentClient()->utility()->OnMessageReceived(msg)) | 92 if (GetContentClient()->utility()->OnMessageReceived(msg)) |
| 92 return true; | 93 return true; |
| 93 | 94 |
| 94 bool handled = true; | 95 bool handled = true; |
| 95 IPC_BEGIN_MESSAGE_MAP(UtilityThreadImpl, msg) | 96 IPC_BEGIN_MESSAGE_MAP(UtilityThreadImpl, msg) |
| 96 IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted) | 97 IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted) |
| 97 IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished) | 98 IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 128 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 129 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
| 129 else | 130 else |
| 130 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); | 131 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); |
| 131 } | 132 } |
| 132 | 133 |
| 133 ReleaseProcessIfNeeded(); | 134 ReleaseProcessIfNeeded(); |
| 134 } | 135 } |
| 135 #endif | 136 #endif |
| 136 | 137 |
| 137 } // namespace content | 138 } // namespace content |
| OLD | NEW |