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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 517813002: Keep a copy of page id in RenderViewHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 | « content/renderer/render_view_impl.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 params->never_visible), 660 params->never_visible),
661 webkit_preferences_(params->webkit_prefs), 661 webkit_preferences_(params->webkit_prefs),
662 send_content_state_immediately_(false), 662 send_content_state_immediately_(false),
663 enabled_bindings_(0), 663 enabled_bindings_(0),
664 send_preferred_size_changes_(false), 664 send_preferred_size_changes_(false),
665 navigation_gesture_(NavigationGestureUnknown), 665 navigation_gesture_(NavigationGestureUnknown),
666 opened_by_user_gesture_(true), 666 opened_by_user_gesture_(true),
667 opener_suppressed_(false), 667 opener_suppressed_(false),
668 suppress_dialogs_until_swap_out_(false), 668 suppress_dialogs_until_swap_out_(false),
669 page_id_(-1), 669 page_id_(-1),
670 page_id_not_yet_reported_(false),
670 last_page_id_sent_to_browser_(-1), 671 last_page_id_sent_to_browser_(-1),
671 next_page_id_(params->next_page_id), 672 next_page_id_(params->next_page_id),
672 history_list_offset_(-1), 673 history_list_offset_(-1),
673 history_list_length_(0), 674 history_list_length_(0),
674 frames_in_progress_(0), 675 frames_in_progress_(0),
675 target_url_status_(TARGET_NONE), 676 target_url_status_(TARGET_NONE),
676 uses_temporary_zoom_level_(false), 677 uses_temporary_zoom_level_(false),
677 #if defined(OS_ANDROID) 678 #if defined(OS_ANDROID)
678 top_controls_constraints_(cc::BOTH), 679 top_controls_constraints_(cc::BOTH),
679 #endif 680 #endif
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 } 1544 }
1544 1545
1545 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) { 1546 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) {
1546 if (!entry) 1547 if (!entry)
1547 return; 1548 return;
1548 1549
1549 // Don't send state updates for kSwappedOutURL. 1550 // Don't send state updates for kSwappedOutURL.
1550 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) 1551 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL))
1551 return; 1552 return;
1552 1553
1554 CHECK(!page_id_not_yet_reported_);
1553 Send(new ViewHostMsg_UpdateState( 1555 Send(new ViewHostMsg_UpdateState(
1554 routing_id_, page_id_, HistoryEntryToPageState(entry))); 1556 routing_id_, page_id_, HistoryEntryToPageState(entry)));
1555 } 1557 }
1556 1558
1557 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { 1559 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
1558 // Before WebKit asks us to show an alert (etc.), it takes care of doing the 1560 // Before WebKit asks us to show an alert (etc.), it takes care of doing the
1559 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog 1561 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog
1560 // it is particularly important that we do not call willEnterModalLoop as 1562 // it is particularly important that we do not call willEnterModalLoop as
1561 // that would defer resource loads for the dialog itself. 1563 // that would defer resource loads for the dialog itself.
1562 if (RenderThreadImpl::current()) // Will be NULL during unit tests. 1564 if (RenderThreadImpl::current()) // Will be NULL during unit tests.
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 // If we have a request in-flight, save the URL to be sent when we 1863 // If we have a request in-flight, save the URL to be sent when we
1862 // receive an ACK to the in-flight request. We can happily overwrite 1864 // receive an ACK to the in-flight request. We can happily overwrite
1863 // any existing pending sends. 1865 // any existing pending sends.
1864 pending_target_url_ = latest_url; 1866 pending_target_url_ = latest_url;
1865 target_url_status_ = TARGET_PENDING; 1867 target_url_status_ = TARGET_PENDING;
1866 } else { 1868 } else {
1867 // URLs larger than |MaxURLChars()| cannot be sent through IPC - 1869 // URLs larger than |MaxURLChars()| cannot be sent through IPC -
1868 // see |ParamTraits<GURL>|. 1870 // see |ParamTraits<GURL>|.
1869 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars()) 1871 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars())
1870 latest_url = GURL(); 1872 latest_url = GURL();
1873 CHECK(!page_id_not_yet_reported_);
1871 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, latest_url)); 1874 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, latest_url));
1872 target_url_ = latest_url; 1875 target_url_ = latest_url;
1873 target_url_status_ = TARGET_INFLIGHT; 1876 target_url_status_ = TARGET_INFLIGHT;
1874 } 1877 }
1875 } 1878 }
1876 1879
1877 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( 1880 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect(
1878 const gfx::RectF& rect) const { 1881 const gfx::RectF& rect) const {
1879 gfx::RectF window_rect = rect; 1882 gfx::RectF window_rect = rect;
1880 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); 1883 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor());
(...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after
4201 std::vector<gfx::Size> sizes; 4204 std::vector<gfx::Size> sizes;
4202 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4205 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4203 if (!url.isEmpty()) 4206 if (!url.isEmpty())
4204 urls.push_back( 4207 urls.push_back(
4205 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4208 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4206 } 4209 }
4207 SendUpdateFaviconURL(urls); 4210 SendUpdateFaviconURL(urls);
4208 } 4211 }
4209 4212
4210 } // namespace content 4213 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698