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

Side by Side Diff: extensions/utility/utility_handler.cc

Issue 2764443002: Utility process: use interfaces rather than overloaded term services (Closed)
Patch Set: Created 3 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 | « chrome/utility/extensions/extensions_handler.cc ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/utility/utility_handler.h" 5 #include "extensions/utility/utility_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "content/public/utility/utility_thread.h" 9 #include "content/public/utility/utility_thread.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); 113 std::string lang = command_line->GetSwitchValueASCII(switches::kLang);
114 if (!lang.empty()) 114 if (!lang.empty())
115 extension_l10n_util::SetProcessLocale(lang); 115 extension_l10n_util::SetProcessLocale(lang);
116 } 116 }
117 117
118 // static 118 // static
119 void UtilityHandler::ExposeInterfacesToBrowser( 119 void UtilityHandler::ExposeInterfacesToBrowser(
120 service_manager::InterfaceRegistry* registry, 120 service_manager::InterfaceRegistry* registry,
121 bool running_elevated) { 121 bool running_elevated) {
122 // If our process runs with elevated privileges, only add elevated Mojo 122 // If our process runs with elevated privileges, only add elevated Mojo
123 // services to the interface registry. 123 // interfaces to the interface registry.
124 if (running_elevated) 124 if (running_elevated)
125 return; 125 return;
126 126
127 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create)); 127 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create));
128 } 128 }
129 129
130 bool UtilityHandler::OnMessageReceived(const IPC::Message& message) { 130 bool UtilityHandler::OnMessageReceived(const IPC::Message& message) {
131 bool handled = true; 131 bool handled = true;
132 IPC_BEGIN_MESSAGE_MAP(UtilityHandler, message) 132 IPC_BEGIN_MESSAGE_MAP(UtilityHandler, message)
133 IPC_MESSAGE_HANDLER(ExtensionUtilityMsg_ParseUpdateManifest, 133 IPC_MESSAGE_HANDLER(ExtensionUtilityMsg_ParseUpdateManifest,
(...skipping 11 matching lines...) Expand all
145 manifest.errors())); 145 manifest.errors()));
146 } else { 146 } else {
147 content::UtilityThread::Get()->Send( 147 content::UtilityThread::Get()->Send(
148 new ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded( 148 new ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded(
149 manifest.results())); 149 manifest.results()));
150 } 150 }
151 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 151 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
152 } 152 }
153 153
154 } // namespace extensions 154 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/utility/extensions/extensions_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698