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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.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) 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/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 if (include_incognito() && GetProfile()->HasOffTheRecordProfile()) 958 if (include_incognito() && GetProfile()->HasOffTheRecordProfile())
959 current_profile = GetProfile()->GetOffTheRecordProfile(); 959 current_profile = GetProfile()->GetOffTheRecordProfile();
960 960
961 content::StoragePartition* storage_partition = 961 content::StoragePartition* storage_partition =
962 BrowserContext::GetStoragePartition( 962 BrowserContext::GetStoragePartition(
963 render_frame_host()->GetProcess()->GetBrowserContext(), 963 render_frame_host()->GetProcess()->GetBrowserContext(),
964 render_frame_host()->GetSiteInstance()); 964 render_frame_host()->GetSiteInstance());
965 std::unique_ptr<content::DownloadUrlParameters> download_params( 965 std::unique_ptr<content::DownloadUrlParameters> download_params(
966 new content::DownloadUrlParameters( 966 new content::DownloadUrlParameters(
967 download_url, render_frame_host()->GetProcess()->GetID(), 967 download_url, render_frame_host()->GetProcess()->GetID(),
968 render_view_host_do_not_use()->GetRoutingID(), 968 render_frame_host()->GetRenderViewHost()->GetRoutingID(),
969 render_frame_host()->GetRoutingID(), 969 render_frame_host()->GetRoutingID(),
970 storage_partition->GetURLRequestContext())); 970 storage_partition->GetURLRequestContext()));
971 971
972 base::FilePath creator_suggested_filename; 972 base::FilePath creator_suggested_filename;
973 if (options.filename.get()) { 973 if (options.filename.get()) {
974 #if defined(OS_WIN) 974 #if defined(OS_WIN)
975 // Can't get filename16 from options.ToValue() because that converts it from 975 // Can't get filename16 from options.ToValue() because that converts it from
976 // std::string. 976 // std::string.
977 base::DictionaryValue* options_value = NULL; 977 base::DictionaryValue* options_value = NULL;
978 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &options_value)); 978 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &options_value));
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 return; 1903 return;
1904 base::Time now(base::Time::Now()); 1904 base::Time now(base::Time::Now());
1905 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); 1905 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT();
1906 if (delta <= kFileExistenceRateLimitSeconds) 1906 if (delta <= kFileExistenceRateLimitSeconds)
1907 return; 1907 return;
1908 last_checked_removal_ = now; 1908 last_checked_removal_ = now;
1909 manager->CheckForHistoryFilesRemoval(); 1909 manager->CheckForHistoryFilesRemoval();
1910 } 1910 }
1911 1911
1912 } // namespace extensions 1912 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698