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

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

Issue 10831302: Download resumption - Preliminary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed signed/unsigned compare issue. Created 8 years 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 scoped_ptr<content::DownloadSaveInfo>(new content::DownloadSaveInfo()), 57 scoped_ptr<content::DownloadSaveInfo>(new content::DownloadSaveInfo()),
58 "",
59 "",
60 content::DownloadId::Invalid(),
58 callback); 61 callback);
59 62
60 if (error != net::OK) { 63 if (error != net::OK) {
61 BrowserThread::PostTask( 64 BrowserThread::PostTask(
62 BrowserThread::UI, FROM_HERE, 65 BrowserThread::UI, FROM_HERE,
63 base::Bind(callback, static_cast<DownloadItem*>(NULL), error)); 66 base::Bind(callback, static_cast<DownloadItem*>(NULL), error));
64 } 67 }
65 } 68 }
66 69
67 } // namespace 70 } // namespace
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); 186 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_);
184 state_ = INSTALLER_STATE_IDLE; 187 state_ = INSTALLER_STATE_IDLE;
185 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); 188 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg));
186 } 189 }
187 190
188 void PluginInstaller::DownloadCancelled() { 191 void PluginInstaller::DownloadCancelled() {
189 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); 192 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_);
190 state_ = INSTALLER_STATE_IDLE; 193 state_ = INSTALLER_STATE_IDLE;
191 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); 194 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled());
192 } 195 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf_context_menu.cc ('k') | chrome/browser/resources/downloads/downloads.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698