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