| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   75   ChildProcess::current()->AddRefProcess(); |   75   ChildProcess::current()->AddRefProcess(); | 
|   76   if (!single_process_) { |   76   if (!single_process_) { | 
|   77     // We can only initialize WebKit on one thread, and in single process mode |   77     // We can only initialize WebKit on one thread, and in single process mode | 
|   78     // we run the utility thread on separate thread. This means that if any code |   78     // we run the utility thread on separate thread. This means that if any code | 
|   79     // needs WebKit initialized in the utility process, they need to have |   79     // needs WebKit initialized in the utility process, they need to have | 
|   80     // another path to support single process mode. |   80     // another path to support single process mode. | 
|   81     blink_platform_impl_.reset(new BlinkPlatformImpl); |   81     blink_platform_impl_.reset(new BlinkPlatformImpl); | 
|   82     blink::initialize(blink_platform_impl_.get()); |   82     blink::initialize(blink_platform_impl_.get()); | 
|   83   } |   83   } | 
|   84   GetContentClient()->utility()->UtilityThreadStarted(); |   84   GetContentClient()->utility()->UtilityThreadStarted(); | 
 |   85   GetContentClient()->utility()->RegisterMojoServices(service_registry()); | 
|   85 } |   86 } | 
|   86  |   87  | 
|   87 bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { |   88 bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { | 
|   88   if (GetContentClient()->utility()->OnMessageReceived(msg)) |   89   if (GetContentClient()->utility()->OnMessageReceived(msg)) | 
|   89     return true; |   90     return true; | 
|   90  |   91  | 
|   91   bool handled = true; |   92   bool handled = true; | 
|   92   IPC_BEGIN_MESSAGE_MAP(UtilityThreadImpl, msg) |   93   IPC_BEGIN_MESSAGE_MAP(UtilityThreadImpl, msg) | 
|   93     IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted) |   94     IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted) | 
|   94     IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished) |   95     IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished) | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|  125       Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |  126       Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 
|  126     else |  127     else | 
|  127       Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); |  128       Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); | 
|  128   } |  129   } | 
|  129  |  130  | 
|  130   ReleaseProcessIfNeeded(); |  131   ReleaseProcessIfNeeded(); | 
|  131 } |  132 } | 
|  132 #endif |  133 #endif | 
|  133  |  134  | 
|  134 }  // namespace content |  135 }  // namespace content | 
| OLD | NEW |