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

Side by Side Diff: chrome/browser/plugins/plugin_installer.cc

Issue 11028131: Shift passage of FileStream in downloads system to be by scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Al's comments. Created 8 years, 2 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/plugins/plugin_installer.h" 5 #include "chrome/browser/plugins/plugin_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ResourceDispatcherHost* rdh = ResourceDispatcherHost::Get(); 47 ResourceDispatcherHost* rdh = ResourceDispatcherHost::Get();
48 scoped_ptr<net::URLRequest> request( 48 scoped_ptr<net::URLRequest> request(
49 resource_context->GetRequestContext()->CreateRequest(url, NULL)); 49 resource_context->GetRequestContext()->CreateRequest(url, NULL));
50 net::Error error = rdh->BeginDownload( 50 net::Error error = rdh->BeginDownload(
51 request.Pass(), 51 request.Pass(),
52 false, // is_content_initiated 52 false, // is_content_initiated
53 resource_context, 53 resource_context,
54 render_process_host_id, 54 render_process_host_id,
55 render_view_host_routing_id, 55 render_view_host_routing_id,
56 true, // prefer_cache 56 true, // prefer_cache
57 content::DownloadSaveInfo(), 57 scoped_ptr<content::DownloadSaveInfo>(new content::DownloadSaveInfo()),
58 callback); 58 callback);
59 59
60 if (error != net::OK) { 60 if (error != net::OK) {
61 BrowserThread::PostTask( 61 BrowserThread::PostTask(
62 BrowserThread::UI, FROM_HERE, 62 BrowserThread::UI, FROM_HERE,
63 base::Bind(callback, static_cast<DownloadItem*>(NULL), error)); 63 base::Bind(callback, static_cast<DownloadItem*>(NULL), error));
64 } 64 }
65 } 65 }
66 66
67 } // namespace 67 } // namespace
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); 182 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_);
183 state_ = INSTALLER_STATE_IDLE; 183 state_ = INSTALLER_STATE_IDLE;
184 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); 184 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg));
185 } 185 }
186 186
187 void PluginInstaller::DownloadCancelled() { 187 void PluginInstaller::DownloadCancelled() {
188 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); 188 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_);
189 state_ = INSTALLER_STATE_IDLE; 189 state_ = INSTALLER_STATE_IDLE;
190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); 190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled());
191 } 191 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698