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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1484093002: Allowing multiple SaveItems to have same URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nested-frames-more-involved-fix
Patch Set: Rebasing... Created 5 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 // The ResourceDispatcherHost may have already been shut down. 1687 // The ResourceDispatcherHost may have already been shut down.
1688 // See http://crbug.com/455098 1688 // See http://crbug.com/455098
1689 if (!scheduler_) 1689 if (!scheduler_)
1690 return; 1690 return;
1691 scheduler_->OnAudibilityChanged(child_id, route_id, is_playing); 1691 scheduler_->OnAudibilityChanged(child_id, route_id, is_playing);
1692 } 1692 }
1693 1693
1694 // This function is only used for saving feature. 1694 // This function is only used for saving feature.
1695 void ResourceDispatcherHostImpl::BeginSaveFile(const GURL& url, 1695 void ResourceDispatcherHostImpl::BeginSaveFile(const GURL& url,
1696 const Referrer& referrer, 1696 const Referrer& referrer,
1697 int save_item_id,
1697 int save_package_id, 1698 int save_package_id,
1698 int child_id, 1699 int child_id,
1699 int render_view_route_id, 1700 int render_view_route_id,
1700 int render_frame_route_id, 1701 int render_frame_route_id,
1701 ResourceContext* context) { 1702 ResourceContext* context) {
1702 if (is_shutdown_) 1703 if (is_shutdown_)
1703 return; 1704 return;
1704 1705
1705 // http://crbug.com/90971 1706 // http://crbug.com/90971
1706 char url_buf[128]; 1707 char url_buf[128];
(...skipping 23 matching lines...) Expand all
1730 // future, maybe we can use a configuration to configure this behavior. 1731 // future, maybe we can use a configuration to configure this behavior.
1731 request->SetLoadFlags(net::LOAD_PREFERRING_CACHE); 1732 request->SetLoadFlags(net::LOAD_PREFERRING_CACHE);
1732 1733
1733 // Since we're just saving some resources we need, disallow downloading. 1734 // Since we're just saving some resources we need, disallow downloading.
1734 ResourceRequestInfoImpl* extra_info = 1735 ResourceRequestInfoImpl* extra_info =
1735 CreateRequestInfo(child_id, render_view_route_id, 1736 CreateRequestInfo(child_id, render_view_route_id,
1736 render_frame_route_id, false, context); 1737 render_frame_route_id, false, context);
1737 extra_info->AssociateWithRequest(request.get()); // Request takes ownership. 1738 extra_info->AssociateWithRequest(request.get()); // Request takes ownership.
1738 1739
1739 scoped_ptr<ResourceHandler> handler(new SaveFileResourceHandler( 1740 scoped_ptr<ResourceHandler> handler(new SaveFileResourceHandler(
1740 request.get(), save_package_id, child_id, render_frame_route_id, url, 1741 request.get(), save_item_id, save_package_id, child_id,
1741 save_file_manager_.get())); 1742 render_frame_route_id, url, save_file_manager_.get()));
1742 1743
1743 BeginRequestInternal(request.Pass(), handler.Pass()); 1744 BeginRequestInternal(request.Pass(), handler.Pass());
1744 } 1745 }
1745 1746
1746 void ResourceDispatcherHostImpl::MarkAsTransferredNavigation( 1747 void ResourceDispatcherHostImpl::MarkAsTransferredNavigation(
1747 const GlobalRequestID& id) { 1748 const GlobalRequestID& id) {
1748 GetLoader(id)->MarkAsTransferring(); 1749 GetLoader(id)->MarkAsTransferring();
1749 } 1750 }
1750 1751
1751 void ResourceDispatcherHostImpl::CancelTransferringNavigation( 1752 void ResourceDispatcherHostImpl::CancelTransferringNavigation(
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 load_flags |= net::LOAD_PREFETCH; 2441 load_flags |= net::LOAD_PREFETCH;
2441 } 2442 }
2442 2443
2443 if (is_sync_load) 2444 if (is_sync_load)
2444 load_flags |= net::LOAD_IGNORE_LIMITS; 2445 load_flags |= net::LOAD_IGNORE_LIMITS;
2445 2446
2446 return load_flags; 2447 return load_flags;
2447 } 2448 }
2448 2449
2449 } // namespace content 2450 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698