Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: content/utility/utility_thread_impl.cc

Issue 940813003: Use a utility process for the Mojo v8 proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-in-process-enable
Patch Set: Remove unneeded forward decl. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/utility/content_utility_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/public/utility/content_utility_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698