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

Side by Side Diff: chrome/browser/extensions/extension_updater.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 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 | Annotate | Revision Log
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 "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/bind.h" 10 #include "base/bind.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/prefs/pref_service.h" 29 #include "chrome/browser/prefs/pref_service.h"
30 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/common/chrome_notification_types.h" 31 #include "chrome/common/chrome_notification_types.h"
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/chrome_utility_messages.h" 33 #include "chrome/common/chrome_utility_messages.h"
34 #include "chrome/common/chrome_version_info.h" 34 #include "chrome/common/chrome_version_info.h"
35 #include "chrome/common/extensions/extension.h" 35 #include "chrome/common/extensions/extension.h"
36 #include "chrome/common/extensions/extension_constants.h" 36 #include "chrome/common/extensions/extension_constants.h"
37 #include "chrome/common/extensions/extension_file_util.h" 37 #include "chrome/common/extensions/extension_file_util.h"
38 #include "chrome/common/pref_names.h" 38 #include "chrome/common/pref_names.h"
39 #include "content/browser/renderer_host/resource_dispatcher_host.h"
39 #include "content/browser/utility_process_host.h" 40 #include "content/browser/utility_process_host.h"
40 #include "content/public/browser/notification_service.h" 41 #include "content/public/browser/notification_service.h"
41 #include "content/public/browser/notification_source.h" 42 #include "content/public/browser/notification_source.h"
42 #include "content/public/common/url_fetcher.h" 43 #include "content/public/common/url_fetcher.h"
43 #include "crypto/sha2.h" 44 #include "crypto/sha2.h"
44 #include "googleurl/src/gurl.h" 45 #include "googleurl/src/gurl.h"
45 #include "net/base/escape.h" 46 #include "net/base/escape.h"
46 #include "net/base/load_flags.h" 47 #include "net/base/load_flags.h"
47 #include "net/url_request/url_request_status.h" 48 #include "net/url_request/url_request_status.h"
48 49
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 630 }
630 631
631 // Posts a task over to the IO loop to start the parsing of xml_ in a 632 // Posts a task over to the IO loop to start the parsing of xml_ in a
632 // utility process. 633 // utility process.
633 void Start() { 634 void Start() {
634 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 635 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
635 if (!BrowserThread::PostTask( 636 if (!BrowserThread::PostTask(
636 BrowserThread::IO, FROM_HERE, 637 BrowserThread::IO, FROM_HERE,
637 base::Bind( 638 base::Bind(
638 &SafeManifestParser::ParseInSandbox, this, 639 &SafeManifestParser::ParseInSandbox, this,
639 g_browser_process->resource_dispatcher_host()))) { 640 ResourceDispatcherHost::Get()))) {
640 NOTREACHED(); 641 NOTREACHED();
641 } 642 }
642 } 643 }
643 644
644 // Creates the sandboxed utility process and tells it to start parsing. 645 // Creates the sandboxed utility process and tells it to start parsing.
645 void ParseInSandbox(ResourceDispatcherHost* rdh) { 646 void ParseInSandbox(ResourceDispatcherHost* rdh) {
646 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 647 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
647 648
648 // TODO(asargent) we shouldn't need to do this branch here - instead 649 // TODO(asargent) we shouldn't need to do this branch here - instead
649 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) 650 // UtilityProcessHost should handle it for us. (http://crbug.com/19192)
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 std::set<std::string>::const_iterator i; 1288 std::set<std::string>::const_iterator i;
1288 for (i = ids.begin(); i != ids.end(); ++i) 1289 for (i = ids.begin(); i != ids.end(); ++i)
1289 in_progress_ids_.insert(*i); 1290 in_progress_ids_.insert(*i);
1290 } 1291 }
1291 1292
1292 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { 1293 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) {
1293 std::set<std::string>::const_iterator i; 1294 std::set<std::string>::const_iterator i;
1294 for (i = ids.begin(); i != ids.end(); ++i) 1295 for (i = ids.begin(); i != ids.end(); ++i)
1295 in_progress_ids_.erase(*i); 1296 in_progress_ids_.erase(*i);
1296 } 1297 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698