OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_management_api.h" | 5 #include "chrome/browser/extensions/extension_management_api.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 205 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
206 BrowserThread::PostTask( | 206 BrowserThread::PostTask( |
207 BrowserThread::IO, | 207 BrowserThread::IO, |
208 FROM_HERE, | 208 FROM_HERE, |
209 base::Bind(&SafeManifestJSONParser::StartWorkOnIOThread, this)); | 209 base::Bind(&SafeManifestJSONParser::StartWorkOnIOThread, this)); |
210 } | 210 } |
211 | 211 |
212 void StartWorkOnIOThread() { | 212 void StartWorkOnIOThread() { |
213 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 213 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
214 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); | 214 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); |
215 #if defined(OS_LINUX) | |
216 utility_host_->set_should_use_zygote(true); | |
Aaron Boodman
2011/12/02 03:10:04
Since most call sites want the zygote enabled, how
Jorge Lucangeli Obes
2011/12/02 18:27:16
The good thing about defaulting to false is that w
Jorge Lucangeli Obes
2011/12/02 20:43:48
Actually, scratch that. I'm pretty sure I got all
| |
217 #endif | |
215 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 218 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
216 } | 219 } |
217 | 220 |
218 virtual bool OnMessageReceived(const IPC::Message& message) { | 221 virtual bool OnMessageReceived(const IPC::Message& message) { |
219 bool handled = true; | 222 bool handled = true; |
220 IPC_BEGIN_MESSAGE_MAP(SafeManifestJSONParser, message) | 223 IPC_BEGIN_MESSAGE_MAP(SafeManifestJSONParser, message) |
221 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, | 224 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
222 OnJSONParseSucceeded) | 225 OnJSONParseSucceeded) |
223 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 226 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
224 OnJSONParseFailed) | 227 OnJSONParseFailed) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 bool escalated = prefs ->DidExtensionEscalatePermissions(extension->id()); | 511 bool escalated = prefs ->DidExtensionEscalatePermissions(extension->id()); |
509 args.Append(CreateExtensionInfo(*extension, enabled, escalated)); | 512 args.Append(CreateExtensionInfo(*extension, enabled, escalated)); |
510 } | 513 } |
511 | 514 |
512 std::string args_json; | 515 std::string args_json; |
513 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 516 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
514 | 517 |
515 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 518 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
516 event_name, args_json, NULL, GURL()); | 519 event_name, args_json, NULL, GURL()); |
517 } | 520 } |
OLD | NEW |