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

Side by Side Diff: content/browser/indexed_db/indexed_db_internals_ui.cc

Issue 1977623002: Updates to DownloadUrlParameters in preparation for OOPIF changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_internals_ui.h" 5 #include "content/browser/indexed_db/indexed_db_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 const base::FilePath& partition_path, 279 const base::FilePath& partition_path,
280 const Origin& origin, 280 const Origin& origin,
281 const base::FilePath temp_path, 281 const base::FilePath temp_path,
282 const base::FilePath zip_path, 282 const base::FilePath zip_path,
283 size_t connection_count) { 283 size_t connection_count) {
284 DCHECK_CURRENTLY_ON(BrowserThread::UI); 284 DCHECK_CURRENTLY_ON(BrowserThread::UI);
285 const GURL url = GURL(FILE_PATH_LITERAL("file://") + zip_path.value()); 285 const GURL url = GURL(FILE_PATH_LITERAL("file://") + zip_path.value());
286 BrowserContext* browser_context = 286 BrowserContext* browser_context =
287 web_ui()->GetWebContents()->GetBrowserContext(); 287 web_ui()->GetWebContents()->GetBrowserContext();
288 std::unique_ptr<DownloadUrlParameters> dl_params( 288 std::unique_ptr<DownloadUrlParameters> dl_params(
289 DownloadUrlParameters::FromWebContents(web_ui()->GetWebContents(), url)); 289 DownloadUrlParameters::CreateForWebContentsMainFrame(
290 web_ui()->GetWebContents(), url));
290 DownloadManager* dlm = BrowserContext::GetDownloadManager(browser_context); 291 DownloadManager* dlm = BrowserContext::GetDownloadManager(browser_context);
291 292
292 const GURL referrer(web_ui()->GetWebContents()->GetLastCommittedURL()); 293 const GURL referrer(web_ui()->GetWebContents()->GetLastCommittedURL());
293 dl_params->set_referrer(content::Referrer::SanitizeForRequest( 294 dl_params->set_referrer(content::Referrer::SanitizeForRequest(
294 url, content::Referrer(referrer, blink::WebReferrerPolicyDefault))); 295 url, content::Referrer(referrer, blink::WebReferrerPolicyDefault)));
295 296
296 // This is how to watch for the download to finish: first wait for it 297 // This is how to watch for the download to finish: first wait for it
297 // to start, then attach a DownloadItem::Observer to observe the 298 // to start, then attach a DownloadItem::Observer to observe the
298 // state change to the finished state. 299 // state change to the finished state.
299 dl_params->set_callback(base::Bind(&IndexedDBInternalsUI::OnDownloadStarted, 300 dl_params->set_callback(base::Bind(&IndexedDBInternalsUI::OnDownloadStarted,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 358
358 item->AddObserver(new FileDeleter(temp_path)); 359 item->AddObserver(new FileDeleter(temp_path));
359 web_ui()->CallJavascriptFunction( 360 web_ui()->CallJavascriptFunction(
360 "indexeddb.onOriginDownloadReady", 361 "indexeddb.onOriginDownloadReady",
361 base::StringValue(partition_path.value()), 362 base::StringValue(partition_path.value()),
362 base::StringValue(origin.Serialize()), 363 base::StringValue(origin.Serialize()),
363 base::FundamentalValue(static_cast<double>(connection_count))); 364 base::FundamentalValue(static_cast<double>(connection_count)));
364 } 365 }
365 366
366 } // namespace content 367 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/drag_download_file.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698