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

Side by Side Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/frame_host/navigation_entry_impl.h" 5 #include "content/browser/frame_host/navigation_entry_impl.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 477 }
478 478
479 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams( 479 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams(
480 const FrameNavigationEntry& frame_entry, 480 const FrameNavigationEntry& frame_entry,
481 base::TimeTicks navigation_start, 481 base::TimeTicks navigation_start,
482 bool is_same_document_history_load, 482 bool is_same_document_history_load,
483 bool has_committed_real_load, 483 bool has_committed_real_load,
484 bool intended_as_new_entry, 484 bool intended_as_new_entry,
485 int pending_history_list_offset, 485 int pending_history_list_offset,
486 int current_history_list_offset, 486 int current_history_list_offset,
487 int current_history_list_length) const { 487 int current_history_list_length,
488 int service_worker_provider_id) const {
488 // Set the redirect chain to the navigation's redirects, unless returning to a 489 // Set the redirect chain to the navigation's redirects, unless returning to a
489 // completed navigation (whose previous redirects don't apply). 490 // completed navigation (whose previous redirects don't apply).
490 std::vector<GURL> redirects; 491 std::vector<GURL> redirects;
491 if (ui::PageTransitionIsNewNavigation(GetTransitionType())) { 492 if (ui::PageTransitionIsNewNavigation(GetTransitionType())) {
492 redirects = GetRedirectChain(); 493 redirects = GetRedirectChain();
493 } 494 }
494 495
495 int pending_offset_to_send = pending_history_list_offset; 496 int pending_offset_to_send = pending_history_list_offset;
496 int current_offset_to_send = current_history_list_offset; 497 int current_offset_to_send = current_history_list_offset;
497 int current_length_to_send = current_history_list_length; 498 int current_length_to_send = current_history_list_length;
498 if (should_clear_history_list()) { 499 if (should_clear_history_list()) {
499 // Set the history list related parameters to the same values a 500 // Set the history list related parameters to the same values a
500 // NavigationController would return before its first navigation. This will 501 // NavigationController would return before its first navigation. This will
501 // fully clear the RenderView's view of the session history. 502 // fully clear the RenderView's view of the session history.
502 pending_offset_to_send = -1; 503 pending_offset_to_send = -1;
503 current_offset_to_send = -1; 504 current_offset_to_send = -1;
504 current_length_to_send = 0; 505 current_length_to_send = 0;
505 } 506 }
506 return RequestNavigationParams( 507 return RequestNavigationParams(
507 GetIsOverridingUserAgent(), navigation_start, redirects, 508 GetIsOverridingUserAgent(), navigation_start, redirects,
508 GetCanLoadLocalResources(), base::Time::Now(), frame_entry.page_state(), 509 GetCanLoadLocalResources(), base::Time::Now(), frame_entry.page_state(),
509 GetPageID(), GetUniqueID(), is_same_document_history_load, 510 GetPageID(), GetUniqueID(), is_same_document_history_load,
510 has_committed_real_load, intended_as_new_entry, pending_offset_to_send, 511 has_committed_real_load, intended_as_new_entry, pending_offset_to_send,
511 current_offset_to_send, current_length_to_send, 512 current_offset_to_send, current_length_to_send,
512 should_clear_history_list()); 513 should_clear_history_list(), service_worker_provider_id);
513 } 514 }
514 515
515 void NavigationEntryImpl::ResetForCommit() { 516 void NavigationEntryImpl::ResetForCommit() {
516 // Any state that only matters when a navigation entry is pending should be 517 // Any state that only matters when a navigation entry is pending should be
517 // cleared here. 518 // cleared here.
518 // TODO(creis): This state should be moved to NavigationRequest once 519 // TODO(creis): This state should be moved to NavigationRequest once
519 // PlzNavigate is enabled. 520 // PlzNavigate is enabled.
520 SetBrowserInitiatedPostData(nullptr); 521 SetBrowserInitiatedPostData(nullptr);
521 set_source_site_instance(nullptr); 522 set_source_site_instance(nullptr);
522 set_is_renderer_initiated(false); 523 set_is_renderer_initiated(false);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 return node; 607 return node;
607 } 608 }
608 // Enqueue any children and keep looking. 609 // Enqueue any children and keep looking.
609 for (auto& child : node->children) 610 for (auto& child : node->children)
610 work_queue.push(child); 611 work_queue.push(child);
611 } 612 }
612 return nullptr; 613 return nullptr;
613 } 614 }
614 615
615 } // namespace content 616 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698