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

Side by Side Diff: chrome/browser/extensions/updater/safe_manifest_parser.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/updater/safe_manifest_parser.h" 5 #include "chrome/browser/extensions/updater/safe_manifest_parser.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 void SafeManifestParser::ParseInSandbox() { 45 void SafeManifestParser::ParseInSandbox() {
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
47 47
48 // TODO(asargent) we shouldn't need to do this branch here - instead 48 // TODO(asargent) we shouldn't need to do this branch here - instead
49 // UtilityProcessHost should handle it for us. (http://crbug.com/19192) 49 // UtilityProcessHost should handle it for us. (http://crbug.com/19192)
50 bool use_utility_process = content::ResourceDispatcherHost::Get() && 50 bool use_utility_process = content::ResourceDispatcherHost::Get() &&
51 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); 51 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
52 if (use_utility_process) { 52 if (use_utility_process) {
53 content::UtilityProcessHost* host = content::UtilityProcessHost::Create( 53 content::UtilityProcessHost* host = content::UtilityProcessHost::Create(
54 this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); 54 this,
55 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get());
55 host->EnableZygote(); 56 host->EnableZygote();
56 host->Send(new ChromeUtilityMsg_ParseUpdateManifest(xml_)); 57 host->Send(new ChromeUtilityMsg_ParseUpdateManifest(xml_));
57 } else { 58 } else {
58 UpdateManifest manifest; 59 UpdateManifest manifest;
59 if (manifest.Parse(xml_)) { 60 if (manifest.Parse(xml_)) {
60 if (!BrowserThread::PostTask( 61 if (!BrowserThread::PostTask(
61 BrowserThread::UI, FROM_HERE, 62 BrowserThread::UI, FROM_HERE,
62 base::Bind( 63 base::Bind(
63 &SafeManifestParser::OnParseUpdateManifestSucceeded, this, 64 &SafeManifestParser::OnParseUpdateManifestSucceeded, this,
64 manifest.results()))) { 65 manifest.results()))) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 void SafeManifestParser::OnParseUpdateManifestFailed( 99 void SafeManifestParser::OnParseUpdateManifestFailed(
99 const std::string& error_message) { 100 const std::string& error_message) {
100 VLOG(2) << "parsing manifest failed (" << fetch_data_->full_url() << ")"; 101 VLOG(2) << "parsing manifest failed (" << fetch_data_->full_url() << ")";
101 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
102 LOG(WARNING) << "Error parsing update manifest:\n" << error_message; 103 LOG(WARNING) << "Error parsing update manifest:\n" << error_message;
103 update_callback_.Run(*fetch_data_, NULL); 104 update_callback_.Run(*fetch_data_, NULL);
104 } 105 }
105 106
106 } // namespace extensions 107 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater_unittest.cc ('k') | chrome/browser/extensions/user_script_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698