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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 // Creates the sandboxed utility process and tells it to start parsing. | 581 // Creates the sandboxed utility process and tells it to start parsing. |
582 void ParseInSandbox(ResourceDispatcherHost* rdh) { | 582 void ParseInSandbox(ResourceDispatcherHost* rdh) { |
583 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 583 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
584 | 584 |
585 // TODO(asargent) we shouldn't need to do this branch here - instead | 585 // TODO(asargent) we shouldn't need to do this branch here - instead |
586 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) | 586 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) |
587 bool use_utility_process = rdh && | 587 bool use_utility_process = rdh && |
588 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | 588 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); |
589 if (use_utility_process) { | 589 if (use_utility_process) { |
590 UtilityProcessHost* host = new UtilityProcessHost( | 590 UtilityProcessHost* host = new UtilityProcessHost( |
591 rdh, this, BrowserThread::UI); | 591 this, BrowserThread::UI); |
592 host->StartUpdateManifestParse(xml_); | 592 host->StartUpdateManifestParse(xml_); |
593 } else { | 593 } else { |
594 UpdateManifest manifest; | 594 UpdateManifest manifest; |
595 if (manifest.Parse(xml_)) { | 595 if (manifest.Parse(xml_)) { |
596 BrowserThread::PostTask( | 596 BrowserThread::PostTask( |
597 BrowserThread::UI, FROM_HERE, | 597 BrowserThread::UI, FROM_HERE, |
598 NewRunnableMethod( | 598 NewRunnableMethod( |
599 this, &SafeManifestParser::OnParseUpdateManifestSucceeded, | 599 this, &SafeManifestParser::OnParseUpdateManifestSucceeded, |
600 manifest.results())); | 600 manifest.results())); |
601 } else { | 601 } else { |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 std::set<std::string>::const_iterator i; | 1076 std::set<std::string>::const_iterator i; |
1077 for (i = ids.begin(); i != ids.end(); ++i) | 1077 for (i = ids.begin(); i != ids.end(); ++i) |
1078 in_progress_ids_.insert(*i); | 1078 in_progress_ids_.insert(*i); |
1079 } | 1079 } |
1080 | 1080 |
1081 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { | 1081 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { |
1082 std::set<std::string>::const_iterator i; | 1082 std::set<std::string>::const_iterator i; |
1083 for (i = ids.begin(); i != ids.end(); ++i) | 1083 for (i = ids.begin(); i != ids.end(); ++i) |
1084 in_progress_ids_.erase(*i); | 1084 in_progress_ids_.erase(*i); |
1085 } | 1085 } |
OLD | NEW |