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

Side by Side Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc

Issue 2611643004: Don't abort the PDF stream if a navigation is intiated within the same page. (Closed)
Patch Set: Fix redness. Created 3 years, 11 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
« no previous file with comments | « chrome/test/data/pdf/pdf_href_replace_state.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h" 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (initial_load_for_frame_ && content::IsBrowserSideNavigationEnabled()) { 216 if (initial_load_for_frame_ && content::IsBrowserSideNavigationEnabled()) {
217 initial_load_for_frame_ = false; 217 initial_load_for_frame_ = false;
218 return; 218 return;
219 } 219 }
220 AbortStream(); 220 AbortStream();
221 } 221 }
222 222
223 void MimeHandlerStreamManager::EmbedderObserver::DidStartNavigation( 223 void MimeHandlerStreamManager::EmbedderObserver::DidStartNavigation(
224 content::NavigationHandle* navigation_handle) { 224 content::NavigationHandle* navigation_handle) {
225 // If the top level frame is navigating away, clean up the stream. 225 // If the top level frame is navigating away, clean up the stream.
226 if (navigation_handle->IsInMainFrame()) 226 if (navigation_handle->IsInMainFrame() && !navigation_handle->IsSamePage())
227 AbortStream(); 227 AbortStream();
228 } 228 }
229 229
230 void MimeHandlerStreamManager::EmbedderObserver::RenderFrameHostChanged( 230 void MimeHandlerStreamManager::EmbedderObserver::RenderFrameHostChanged(
231 content::RenderFrameHost* old_host, 231 content::RenderFrameHost* old_host,
232 content::RenderFrameHost* new_host) { 232 content::RenderFrameHost* new_host) {
233 // If the old_host is null, then it means that a subframe is being created. 233 // If the old_host is null, then it means that a subframe is being created.
234 // Don't treat this like a host change. 234 // Don't treat this like a host change.
235 if (!old_host) 235 if (!old_host)
236 return; 236 return;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (frame_tree_node_id_ != -1) { 277 if (frame_tree_node_id_ != -1) {
278 return render_frame_host->GetFrameTreeNodeId() == frame_tree_node_id_; 278 return render_frame_host->GetFrameTreeNodeId() == frame_tree_node_id_;
279 } else { 279 } else {
280 DCHECK((render_frame_id_ != -1) && (render_process_id_ != -1)); 280 DCHECK((render_frame_id_ != -1) && (render_process_id_ != -1));
281 return render_frame_host->GetRoutingID() == render_frame_id_ && 281 return render_frame_host->GetRoutingID() == render_frame_id_ &&
282 render_frame_host->GetProcess()->GetID() == render_process_id_; 282 render_frame_host->GetProcess()->GetID() == render_process_id_;
283 } 283 }
284 } 284 }
285 285
286 } // namespace extensions 286 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/test/data/pdf/pdf_href_replace_state.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698