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

Side by Side Diff: chrome/browser/safe_browsing/sandboxed_zip_analyzer.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/safe_browsing/sandboxed_zip_analyzer.h" 5 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 void SandboxedZipAnalyzer::RunCallback(const zip_analyzer::Results& results) { 111 void SandboxedZipAnalyzer::RunCallback(const zip_analyzer::Results& results) {
112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
113 callback_.Run(results); 113 callback_.Run(results);
114 } 114 }
115 115
116 void SandboxedZipAnalyzer::StartProcessOnIOThread() { 116 void SandboxedZipAnalyzer::StartProcessOnIOThread() {
117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
118 utility_process_host_ = content::UtilityProcessHost::Create( 118 utility_process_host_ = content::UtilityProcessHost::Create(
119 this, 119 this,
120 BrowserThread::GetMessageLoopProxyForThread( 120 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())
121 BrowserThread::IO))->AsWeakPtr(); 121 ->AsWeakPtr();
122 utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); 122 utility_process_host_->Send(new ChromeUtilityMsg_StartupPing);
123 // Wait for the startup notification before sending the main IPC to the 123 // Wait for the startup notification before sending the main IPC to the
124 // utility process, so that we can dup the file handle. 124 // utility process, so that we can dup the file handle.
125 } 125 }
126 126
127 void SandboxedZipAnalyzer::OnUtilityProcessStarted() { 127 void SandboxedZipAnalyzer::OnUtilityProcessStarted() {
128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
129 if (utility_process_host_->GetData().handle == base::kNullProcessHandle) { 129 if (utility_process_host_->GetData().handle == base::kNullProcessHandle) {
130 DLOG(ERROR) << "Child process handle is null"; 130 DLOG(ERROR) << "Child process handle is null";
131 } 131 }
132 utility_process_host_->Send( 132 utility_process_host_->Send(
133 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection( 133 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection(
134 IPC::GetFileHandleForProcess( 134 IPC::GetFileHandleForProcess(
135 zip_platform_file_, 135 zip_platform_file_,
136 utility_process_host_->GetData().handle, 136 utility_process_host_->GetData().handle,
137 true /* close_source_handle */))); 137 true /* close_source_handle */)));
138 } 138 }
139 139
140 } // namespace safe_browsing 140 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698