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_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 // Creates the sandboxed utility process and tells it to start parsing. | 572 // Creates the sandboxed utility process and tells it to start parsing. |
573 void ParseInSandbox(ResourceDispatcherHost* rdh) { | 573 void ParseInSandbox(ResourceDispatcherHost* rdh) { |
574 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 574 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
575 | 575 |
576 // TODO(asargent) we shouldn't need to do this branch here - instead | 576 // TODO(asargent) we shouldn't need to do this branch here - instead |
577 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) | 577 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) |
578 bool use_utility_process = rdh && | 578 bool use_utility_process = rdh && |
579 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 579 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); |
580 if (use_utility_process) { | 580 if (use_utility_process) { |
581 UtilityProcessHost* host = new UtilityProcessHost( | 581 UtilityProcessHost* host = new UtilityProcessHost( |
582 rdh, this, BrowserThread::UI); | 582 this, BrowserThread::UI); |
583 host->StartUpdateManifestParse(xml_); | 583 host->StartUpdateManifestParse(xml_); |
584 } else { | 584 } else { |
585 UpdateManifest manifest; | 585 UpdateManifest manifest; |
586 if (manifest.Parse(xml_)) { | 586 if (manifest.Parse(xml_)) { |
587 BrowserThread::PostTask( | 587 BrowserThread::PostTask( |
588 BrowserThread::UI, FROM_HERE, | 588 BrowserThread::UI, FROM_HERE, |
589 NewRunnableMethod( | 589 NewRunnableMethod( |
590 this, &SafeManifestParser::OnParseUpdateManifestSucceeded, | 590 this, &SafeManifestParser::OnParseUpdateManifestSucceeded, |
591 manifest.results())); | 591 manifest.results())); |
592 } else { | 592 } else { |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 std::set<std::string>::const_iterator i; | 1068 std::set<std::string>::const_iterator i; |
1069 for (i = ids.begin(); i != ids.end(); ++i) | 1069 for (i = ids.begin(); i != ids.end(); ++i) |
1070 in_progress_ids_.insert(*i); | 1070 in_progress_ids_.insert(*i); |
1071 } | 1071 } |
1072 | 1072 |
1073 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { | 1073 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { |
1074 std::set<std::string>::const_iterator i; | 1074 std::set<std::string>::const_iterator i; |
1075 for (i = ids.begin(); i != ids.end(); ++i) | 1075 for (i = ids.begin(); i != ids.end(); ++i) |
1076 in_progress_ids_.erase(*i); | 1076 in_progress_ids_.erase(*i); |
1077 } | 1077 } |
OLD | NEW |