OLD | NEW |
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_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 // If we are reloading an entry that no longer belongs to the current | 332 // If we are reloading an entry that no longer belongs to the current |
333 // site instance (for example, refreshing a page for just installed app), | 333 // site instance (for example, refreshing a page for just installed app), |
334 // the reload must happen in a new process. | 334 // the reload must happen in a new process. |
335 // The new entry must have a new page_id and site instance, so it behaves | 335 // The new entry must have a new page_id and site instance, so it behaves |
336 // as new navigation (which happens to clear forward history). | 336 // as new navigation (which happens to clear forward history). |
337 // Tabs that are discarded due to low memory conditions may not have a site | 337 // Tabs that are discarded due to low memory conditions may not have a site |
338 // instance, and should not be treated as a cross-site reload. | 338 // instance, and should not be treated as a cross-site reload. |
339 SiteInstanceImpl* site_instance = entry->site_instance(); | 339 SiteInstanceImpl* site_instance = entry->site_instance(); |
340 // Permit reloading guests without further checks. | 340 // Permit reloading guests without further checks. |
341 bool is_guest = site_instance && site_instance->HasProcess() && | 341 bool is_isolated_guest = site_instance && site_instance->HasProcess() && |
342 site_instance->GetProcess()->IsGuest(); | 342 site_instance->GetProcess()->IsIsolatedGuest(); |
343 if (!is_guest && site_instance && | 343 if (!is_isolated_guest && site_instance && |
344 site_instance->HasWrongProcessForURL(entry->GetURL())) { | 344 site_instance->HasWrongProcessForURL(entry->GetURL())) { |
345 // Create a navigation entry that resembles the current one, but do not | 345 // Create a navigation entry that resembles the current one, but do not |
346 // copy page id, site instance, content state, or timestamp. | 346 // copy page id, site instance, content state, or timestamp. |
347 NavigationEntryImpl* nav_entry = NavigationEntryImpl::FromNavigationEntry( | 347 NavigationEntryImpl* nav_entry = NavigationEntryImpl::FromNavigationEntry( |
348 CreateNavigationEntry( | 348 CreateNavigationEntry( |
349 entry->GetURL(), entry->GetReferrer(), entry->GetTransitionType(), | 349 entry->GetURL(), entry->GetReferrer(), entry->GetTransitionType(), |
350 false, entry->extra_headers(), browser_context_)); | 350 false, entry->extra_headers(), browser_context_)); |
351 | 351 |
352 // Mark the reload type as NO_RELOAD, so navigation will not be considered | 352 // Mark the reload type as NO_RELOAD, so navigation will not be considered |
353 // a reload in the renderer. | 353 // a reload in the renderer. |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 } | 1761 } |
1762 } | 1762 } |
1763 } | 1763 } |
1764 | 1764 |
1765 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1765 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1766 const base::Callback<base::Time()>& get_timestamp_callback) { | 1766 const base::Callback<base::Time()>& get_timestamp_callback) { |
1767 get_timestamp_callback_ = get_timestamp_callback; | 1767 get_timestamp_callback_ = get_timestamp_callback; |
1768 } | 1768 } |
1769 | 1769 |
1770 } // namespace content | 1770 } // namespace content |
OLD | NEW |