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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/alias.h" | 11 #include "base/debug/alias.h" |
12 #include "base/debug/dump_without_crashing.h" | 12 #include "base/debug/dump_without_crashing.h" |
13 #include "base/i18n/char_iterator.h" | 13 #include "base/i18n/char_iterator.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/process/kill.h" |
| 16 #include "base/process/process.h" |
15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
16 #include "base/time/time.h" | 18 #include "base/time/time.h" |
17 #include "content/child/appcache/appcache_dispatcher.h" | 19 #include "content/child/appcache/appcache_dispatcher.h" |
18 #include "content/child/plugin_messages.h" | 20 #include "content/child/plugin_messages.h" |
19 #include "content/child/quota_dispatcher.h" | 21 #include "content/child/quota_dispatcher.h" |
20 #include "content/child/request_extra_data.h" | 22 #include "content/child/request_extra_data.h" |
21 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 23 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
22 #include "content/common/frame_messages.h" | 24 #include "content/common/frame_messages.h" |
23 #include "content/common/socket_stream_handle_data.h" | 25 #include "content/common/socket_stream_handle_data.h" |
24 #include "content/common/swapped_out_messages.h" | 26 #include "content/common/swapped_out_messages.h" |
(...skipping 17 matching lines...) Expand all Loading... |
42 #include "content/renderer/context_menu_params_builder.h" | 44 #include "content/renderer/context_menu_params_builder.h" |
43 #include "content/renderer/dom_automation_controller.h" | 45 #include "content/renderer/dom_automation_controller.h" |
44 #include "content/renderer/internal_document_state_data.h" | 46 #include "content/renderer/internal_document_state_data.h" |
45 #include "content/renderer/npapi/plugin_channel_host.h" | 47 #include "content/renderer/npapi/plugin_channel_host.h" |
46 #include "content/renderer/render_thread_impl.h" | 48 #include "content/renderer/render_thread_impl.h" |
47 #include "content/renderer/render_view_impl.h" | 49 #include "content/renderer/render_view_impl.h" |
48 #include "content/renderer/render_widget_fullscreen_pepper.h" | 50 #include "content/renderer/render_widget_fullscreen_pepper.h" |
49 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 51 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
50 #include "content/renderer/shared_worker_repository.h" | 52 #include "content/renderer/shared_worker_repository.h" |
51 #include "content/renderer/websharedworker_proxy.h" | 53 #include "content/renderer/websharedworker_proxy.h" |
| 54 #include "net/base/data_url.h" |
52 #include "net/base/net_errors.h" | 55 #include "net/base/net_errors.h" |
53 #include "net/http/http_util.h" | 56 #include "net/http/http_util.h" |
54 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 57 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
55 #include "third_party/WebKit/public/platform/WebString.h" | 58 #include "third_party/WebKit/public/platform/WebString.h" |
56 #include "third_party/WebKit/public/platform/WebURL.h" | 59 #include "third_party/WebKit/public/platform/WebURL.h" |
57 #include "third_party/WebKit/public/platform/WebURLError.h" | 60 #include "third_party/WebKit/public/platform/WebURLError.h" |
58 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 61 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
59 #include "third_party/WebKit/public/platform/WebVector.h" | 62 #include "third_party/WebKit/public/platform/WebVector.h" |
60 #include "third_party/WebKit/public/web/WebDocument.h" | 63 #include "third_party/WebKit/public/web/WebDocument.h" |
61 #include "third_party/WebKit/public/web/WebFrame.h" | 64 #include "third_party/WebKit/public/web/WebFrame.h" |
(...skipping 14 matching lines...) Expand all Loading... |
76 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 79 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
77 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 80 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
78 #include "content/renderer/pepper/plugin_module.h" | 81 #include "content/renderer/pepper/plugin_module.h" |
79 #endif | 82 #endif |
80 | 83 |
81 #if defined(ENABLE_WEBRTC) | 84 #if defined(ENABLE_WEBRTC) |
82 #include "content/renderer/media/rtc_peer_connection_handler.h" | 85 #include "content/renderer/media/rtc_peer_connection_handler.h" |
83 #endif | 86 #endif |
84 | 87 |
85 using blink::WebContextMenuData; | 88 using blink::WebContextMenuData; |
| 89 using blink::WebData; |
86 using blink::WebDataSource; | 90 using blink::WebDataSource; |
87 using blink::WebDocument; | 91 using blink::WebDocument; |
88 using blink::WebFrame; | 92 using blink::WebFrame; |
89 using blink::WebHistoryItem; | 93 using blink::WebHistoryItem; |
| 94 using blink::WebHTTPBody; |
90 using blink::WebNavigationPolicy; | 95 using blink::WebNavigationPolicy; |
91 using blink::WebPluginParams; | 96 using blink::WebPluginParams; |
92 using blink::WebReferrerPolicy; | 97 using blink::WebReferrerPolicy; |
93 using blink::WebSearchableFormData; | 98 using blink::WebSearchableFormData; |
94 using blink::WebSecurityOrigin; | 99 using blink::WebSecurityOrigin; |
95 using blink::WebSecurityPolicy; | 100 using blink::WebSecurityPolicy; |
96 using blink::WebServiceWorkerProvider; | 101 using blink::WebServiceWorkerProvider; |
97 using blink::WebStorageQuotaCallbacks; | 102 using blink::WebStorageQuotaCallbacks; |
98 using blink::WebString; | 103 using blink::WebString; |
99 using blink::WebURL; | 104 using blink::WebURL; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ds->redirectChain(urls); | 142 ds->redirectChain(urls); |
138 result->reserve(urls.size()); | 143 result->reserve(urls.size()); |
139 for (size_t i = 0; i < urls.size(); ++i) { | 144 for (size_t i = 0; i < urls.size(); ++i) { |
140 if (urls[i] != GURL(kSwappedOutURL)) | 145 if (urls[i] != GURL(kSwappedOutURL)) |
141 result->push_back(urls[i]); | 146 result->push_back(urls[i]); |
142 else | 147 else |
143 result->push_back(blank_url); | 148 result->push_back(blank_url); |
144 } | 149 } |
145 } | 150 } |
146 | 151 |
| 152 NOINLINE static void CrashIntentionally() { |
| 153 // NOTE(shess): Crash directly rather than using NOTREACHED() so |
| 154 // that the signature is easier to triage in crash reports. |
| 155 volatile int* zero = NULL; |
| 156 *zero = 0; |
| 157 } |
| 158 |
| 159 #if defined(ADDRESS_SANITIZER) |
| 160 NOINLINE static void MaybeTriggerAsanError(const GURL& url) { |
| 161 // NOTE(rogerm): We intentionally perform an invalid heap access here in |
| 162 // order to trigger an Address Sanitizer (ASAN) error report. |
| 163 static const char kCrashDomain[] = "crash"; |
| 164 static const char kHeapOverflow[] = "/heap-overflow"; |
| 165 static const char kHeapUnderflow[] = "/heap-underflow"; |
| 166 static const char kUseAfterFree[] = "/use-after-free"; |
| 167 static const int kArraySize = 5; |
| 168 |
| 169 if (!url.DomainIs(kCrashDomain, sizeof(kCrashDomain) - 1)) |
| 170 return; |
| 171 |
| 172 if (!url.has_path()) |
| 173 return; |
| 174 |
| 175 scoped_ptr<int[]> array(new int[kArraySize]); |
| 176 std::string crash_type(url.path()); |
| 177 int dummy = 0; |
| 178 if (crash_type == kHeapOverflow) { |
| 179 dummy = array[kArraySize]; |
| 180 } else if (crash_type == kHeapUnderflow ) { |
| 181 dummy = array[-1]; |
| 182 } else if (crash_type == kUseAfterFree) { |
| 183 int* dangling = array.get(); |
| 184 array.reset(); |
| 185 dummy = dangling[kArraySize / 2]; |
| 186 } |
| 187 |
| 188 // Make sure the assignments to the dummy value aren't optimized away. |
| 189 base::debug::Alias(&dummy); |
| 190 } |
| 191 #endif // ADDRESS_SANITIZER |
| 192 |
| 193 static void MaybeHandleDebugURL(const GURL& url) { |
| 194 if (!url.SchemeIs(kChromeUIScheme)) |
| 195 return; |
| 196 if (url == GURL(kChromeUICrashURL)) { |
| 197 CrashIntentionally(); |
| 198 } else if (url == GURL(kChromeUIKillURL)) { |
| 199 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); |
| 200 } else if (url == GURL(kChromeUIHangURL)) { |
| 201 for (;;) { |
| 202 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); |
| 203 } |
| 204 } else if (url == GURL(kChromeUIShorthangURL)) { |
| 205 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
| 206 } |
| 207 |
| 208 #if defined(ADDRESS_SANITIZER) |
| 209 MaybeTriggerAsanError(url); |
| 210 #endif // ADDRESS_SANITIZER |
| 211 } |
| 212 |
147 } // namespace | 213 } // namespace |
148 | 214 |
149 static RenderFrameImpl* (*g_create_render_frame_impl)(RenderViewImpl*, int32) = | 215 static RenderFrameImpl* (*g_create_render_frame_impl)(RenderViewImpl*, int32) = |
150 NULL; | 216 NULL; |
151 | 217 |
152 // static | 218 // static |
153 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view, | 219 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view, |
154 int32 routing_id) { | 220 int32 routing_id) { |
155 DCHECK(routing_id != MSG_ROUTING_NONE); | 221 DCHECK(routing_id != MSG_ROUTING_NONE); |
156 | 222 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 ObserverListBase<RenderFrameObserver>::Iterator it(observers_); | 482 ObserverListBase<RenderFrameObserver>::Iterator it(observers_); |
417 RenderFrameObserver* observer; | 483 RenderFrameObserver* observer; |
418 while ((observer = it.GetNext()) != NULL) { | 484 while ((observer = it.GetNext()) != NULL) { |
419 if (observer->OnMessageReceived(msg)) | 485 if (observer->OnMessageReceived(msg)) |
420 return true; | 486 return true; |
421 } | 487 } |
422 | 488 |
423 bool handled = true; | 489 bool handled = true; |
424 bool msg_is_ok = true; | 490 bool msg_is_ok = true; |
425 IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameImpl, msg, msg_is_ok) | 491 IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameImpl, msg, msg_is_ok) |
| 492 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
426 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) | 493 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) |
427 IPC_MESSAGE_HANDLER(FrameMsg_BuffersSwapped, OnBuffersSwapped) | 494 IPC_MESSAGE_HANDLER(FrameMsg_BuffersSwapped, OnBuffersSwapped) |
428 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, | 495 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, |
429 OnCompositorFrameSwapped(msg)) | 496 OnCompositorFrameSwapped(msg)) |
430 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 497 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
431 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) | 498 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) |
432 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, | 499 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, |
433 OnCustomContextMenuAction) | 500 OnCustomContextMenuAction) |
434 IPC_END_MESSAGE_MAP_EX() | 501 IPC_END_MESSAGE_MAP_EX() |
435 | 502 |
436 if (!msg_is_ok) { | 503 if (!msg_is_ok) { |
437 // The message had a handler, but its deserialization failed. | 504 // The message had a handler, but its deserialization failed. |
438 // Kill the renderer to avoid potential spoofing attacks. | 505 // Kill the renderer to avoid potential spoofing attacks. |
439 CHECK(false) << "Unable to deserialize message in RenderFrameImpl."; | 506 CHECK(false) << "Unable to deserialize message in RenderFrameImpl."; |
440 } | 507 } |
441 | 508 |
442 return handled; | 509 return handled; |
443 } | 510 } |
| 511 |
| 512 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { |
| 513 MaybeHandleDebugURL(params.url); |
| 514 if (!render_view_->webview()) |
| 515 return; |
| 516 |
| 517 render_view_->OnNavigate(params); |
| 518 |
| 519 bool is_reload = RenderViewImpl::IsReload(params); |
| 520 WebURLRequest::CachePolicy cache_policy = |
| 521 WebURLRequest::UseProtocolCachePolicy; |
| 522 |
| 523 // If this is a stale back/forward (due to a recent navigation the browser |
| 524 // didn't know about), ignore it. |
| 525 if (render_view_->IsBackForwardToStaleEntry(params, is_reload)) |
| 526 return; |
| 527 |
| 528 // Swap this renderer back in if necessary. |
| 529 if (render_view_->is_swapped_out_) { |
| 530 // We marked the view as hidden when swapping the view out, so be sure to |
| 531 // reset the visibility state before navigating to the new URL. |
| 532 render_view_->webview()->setVisibilityState( |
| 533 render_view_->visibilityState(), false); |
| 534 |
| 535 // If this is an attempt to reload while we are swapped out, we should not |
| 536 // reload swappedout://, but the previous page, which is stored in |
| 537 // params.state. Setting is_reload to false will treat this like a back |
| 538 // navigation to accomplish that. |
| 539 is_reload = false; |
| 540 cache_policy = WebURLRequest::ReloadIgnoringCacheData; |
| 541 |
| 542 // We refresh timezone when a view is swapped in since timezone |
| 543 // can get out of sync when the system timezone is updated while |
| 544 // the view is swapped out. |
| 545 RenderViewImpl::NotifyTimezoneChange(render_view_->webview()->mainFrame()); |
| 546 |
| 547 render_view_->SetSwappedOut(false); |
| 548 is_swapped_out_ = false; |
| 549 } |
| 550 |
| 551 if (params.should_clear_history_list) { |
| 552 CHECK_EQ(params.pending_history_list_offset, -1); |
| 553 CHECK_EQ(params.current_history_list_offset, -1); |
| 554 CHECK_EQ(params.current_history_list_length, 0); |
| 555 } |
| 556 render_view_->history_list_offset_ = params.current_history_list_offset; |
| 557 render_view_->history_list_length_ = params.current_history_list_length; |
| 558 if (render_view_->history_list_length_ >= 0) { |
| 559 render_view_->history_page_ids_.resize( |
| 560 render_view_->history_list_length_, -1); |
| 561 } |
| 562 if (params.pending_history_list_offset >= 0 && |
| 563 params.pending_history_list_offset < render_view_->history_list_length_) { |
| 564 render_view_->history_page_ids_[params.pending_history_list_offset] = |
| 565 params.page_id; |
| 566 } |
| 567 |
| 568 GetContentClient()->SetActiveURL(params.url); |
| 569 |
| 570 WebFrame* frame = frame_; |
| 571 if (!params.frame_to_navigate.empty()) { |
| 572 // TODO(nasko): Move this lookup to the browser process. |
| 573 frame = render_view_->webview()->findFrameByName( |
| 574 WebString::fromUTF8(params.frame_to_navigate)); |
| 575 CHECK(frame) << "Invalid frame name passed: " << params.frame_to_navigate; |
| 576 } |
| 577 |
| 578 if (is_reload && frame->currentHistoryItem().isNull()) { |
| 579 // We cannot reload if we do not have any history state. This happens, for |
| 580 // example, when recovering from a crash. |
| 581 is_reload = false; |
| 582 cache_policy = WebURLRequest::ReloadIgnoringCacheData; |
| 583 } |
| 584 |
| 585 render_view_->pending_navigation_params_.reset( |
| 586 new FrameMsg_Navigate_Params(params)); |
| 587 |
| 588 // If we are reloading, then WebKit will use the history state of the current |
| 589 // page, so we should just ignore any given history state. Otherwise, if we |
| 590 // have history state, then we need to navigate to it, which corresponds to a |
| 591 // back/forward navigation event. |
| 592 if (is_reload) { |
| 593 bool reload_original_url = |
| 594 (params.navigation_type == |
| 595 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL); |
| 596 bool ignore_cache = (params.navigation_type == |
| 597 FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE); |
| 598 |
| 599 if (reload_original_url) |
| 600 frame->reloadWithOverrideURL(params.url, true); |
| 601 else |
| 602 frame->reload(ignore_cache); |
| 603 } else if (params.page_state.IsValid()) { |
| 604 // We must know the page ID of the page we are navigating back to. |
| 605 DCHECK_NE(params.page_id, -1); |
| 606 WebHistoryItem item = PageStateToHistoryItem(params.page_state); |
| 607 if (!item.isNull()) { |
| 608 // Ensure we didn't save the swapped out URL in UpdateState, since the |
| 609 // browser should never be telling us to navigate to swappedout://. |
| 610 CHECK(item.urlString() != WebString::fromUTF8(kSwappedOutURL)); |
| 611 frame->loadHistoryItem(item, cache_policy); |
| 612 } |
| 613 } else if (!params.base_url_for_data_url.is_empty()) { |
| 614 // A loadData request with a specified base URL. |
| 615 std::string mime_type, charset, data; |
| 616 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { |
| 617 frame->loadData( |
| 618 WebData(data.c_str(), data.length()), |
| 619 WebString::fromUTF8(mime_type), |
| 620 WebString::fromUTF8(charset), |
| 621 params.base_url_for_data_url, |
| 622 params.history_url_for_data_url, |
| 623 false); |
| 624 } else { |
| 625 CHECK(false) << |
| 626 "Invalid URL passed: " << params.url.possibly_invalid_spec(); |
| 627 } |
| 628 } else { |
| 629 // Navigate to the given URL. |
| 630 WebURLRequest request(params.url); |
| 631 |
| 632 // A session history navigation should have been accompanied by state. |
| 633 CHECK_EQ(params.page_id, -1); |
| 634 |
| 635 if (frame->isViewSourceModeEnabled()) |
| 636 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); |
| 637 |
| 638 if (params.referrer.url.is_valid()) { |
| 639 WebString referrer = WebSecurityPolicy::generateReferrerHeader( |
| 640 params.referrer.policy, |
| 641 params.url, |
| 642 WebString::fromUTF8(params.referrer.url.spec())); |
| 643 if (!referrer.isEmpty()) |
| 644 request.setHTTPReferrer(referrer, params.referrer.policy); |
| 645 } |
| 646 |
| 647 if (!params.extra_headers.empty()) { |
| 648 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), |
| 649 params.extra_headers.end(), "\n"); |
| 650 i.GetNext(); ) { |
| 651 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), |
| 652 WebString::fromUTF8(i.values())); |
| 653 } |
| 654 } |
| 655 |
| 656 if (params.is_post) { |
| 657 request.setHTTPMethod(WebString::fromUTF8("POST")); |
| 658 |
| 659 // Set post data. |
| 660 WebHTTPBody http_body; |
| 661 http_body.initialize(); |
| 662 const char* data = NULL; |
| 663 if (params.browser_initiated_post_data.size()) { |
| 664 data = reinterpret_cast<const char*>( |
| 665 ¶ms.browser_initiated_post_data.front()); |
| 666 } |
| 667 http_body.appendData( |
| 668 WebData(data, params.browser_initiated_post_data.size())); |
| 669 request.setHTTPBody(http_body); |
| 670 } |
| 671 |
| 672 frame->loadRequest(request); |
| 673 |
| 674 // If this is a cross-process navigation, the browser process will send |
| 675 // along the proper navigation start value. |
| 676 if (!params.browser_navigation_start.is_null() && |
| 677 frame->provisionalDataSource()) { |
| 678 // browser_navigation_start is likely before this process existed, so we |
| 679 // can't use InterProcessTimeTicksConverter. Instead, the best we can do |
| 680 // is just ensure we don't report a bogus value in the future. |
| 681 base::TimeTicks navigation_start = std::min( |
| 682 base::TimeTicks::Now(), params.browser_navigation_start); |
| 683 double navigation_start_seconds = |
| 684 (navigation_start - base::TimeTicks()).InSecondsF(); |
| 685 frame->provisionalDataSource()->setNavigationStartTime( |
| 686 navigation_start_seconds); |
| 687 } |
| 688 } |
| 689 |
| 690 // In case LoadRequest failed before DidCreateDataSource was called. |
| 691 render_view_->pending_navigation_params_.reset(); |
| 692 } |
444 | 693 |
445 void RenderFrameImpl::OnSwapOut() { | 694 void RenderFrameImpl::OnSwapOut() { |
446 // Only run unload if we're not swapped out yet, but send the ack either way. | 695 // Only run unload if we're not swapped out yet, but send the ack either way. |
447 if (!is_swapped_out_) { | 696 if (!is_swapped_out_) { |
448 // Swap this RenderView out so the tab can navigate to a page rendered by a | 697 // Swap this RenderView out so the tab can navigate to a page rendered by a |
449 // different process. This involves running the unload handler and clearing | 698 // different process. This involves running the unload handler and clearing |
450 // the page. Once WasSwappedOut is called, we also allow this process to | 699 // the page. Once WasSwappedOut is called, we also allow this process to |
451 // exit if there are no other active RenderViews in it. | 700 // exit if there are no other active RenderViews in it. |
452 | 701 |
453 // Send an UpdateState message before we get swapped out. | 702 // Send an UpdateState message before we get swapped out. |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 // TODO(davidben): This should also take the failed navigation's replacement | 1331 // TODO(davidben): This should also take the failed navigation's replacement |
1083 // state into account, if a location.replace() failed. | 1332 // state into account, if a location.replace() failed. |
1084 bool replace = | 1333 bool replace = |
1085 navigation_state->pending_page_id() != -1 || | 1334 navigation_state->pending_page_id() != -1 || |
1086 PageTransitionCoreTypeIs(navigation_state->transition_type(), | 1335 PageTransitionCoreTypeIs(navigation_state->transition_type(), |
1087 PAGE_TRANSITION_AUTO_SUBFRAME); | 1336 PAGE_TRANSITION_AUTO_SUBFRAME); |
1088 | 1337 |
1089 // If we failed on a browser initiated request, then make sure that our error | 1338 // If we failed on a browser initiated request, then make sure that our error |
1090 // page load is regarded as the same browser initiated request. | 1339 // page load is regarded as the same browser initiated request. |
1091 if (!navigation_state->is_content_initiated()) { | 1340 if (!navigation_state->is_content_initiated()) { |
1092 render_view_->pending_navigation_params_.reset(new ViewMsg_Navigate_Params); | 1341 render_view_->pending_navigation_params_.reset( |
| 1342 new FrameMsg_Navigate_Params); |
1093 render_view_->pending_navigation_params_->page_id = | 1343 render_view_->pending_navigation_params_->page_id = |
1094 navigation_state->pending_page_id(); | 1344 navigation_state->pending_page_id(); |
1095 render_view_->pending_navigation_params_->pending_history_list_offset = | 1345 render_view_->pending_navigation_params_->pending_history_list_offset = |
1096 navigation_state->pending_history_list_offset(); | 1346 navigation_state->pending_history_list_offset(); |
1097 render_view_->pending_navigation_params_->should_clear_history_list = | 1347 render_view_->pending_navigation_params_->should_clear_history_list = |
1098 navigation_state->history_list_was_cleared(); | 1348 navigation_state->history_list_was_cleared(); |
1099 render_view_->pending_navigation_params_->transition = | 1349 render_view_->pending_navigation_params_->transition = |
1100 navigation_state->transition_type(); | 1350 navigation_state->transition_type(); |
1101 render_view_->pending_navigation_params_->request_time = | 1351 render_view_->pending_navigation_params_->request_time = |
1102 document_state->request_time(); | 1352 document_state->request_time(); |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 | 2275 |
2026 void RenderFrameImpl::didStartLoading() { | 2276 void RenderFrameImpl::didStartLoading() { |
2027 Send(new FrameHostMsg_DidStartLoading(routing_id_)); | 2277 Send(new FrameHostMsg_DidStartLoading(routing_id_)); |
2028 } | 2278 } |
2029 | 2279 |
2030 void RenderFrameImpl::didStopLoading() { | 2280 void RenderFrameImpl::didStopLoading() { |
2031 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 2281 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
2032 } | 2282 } |
2033 | 2283 |
2034 } // namespace content | 2284 } // namespace content |
OLD | NEW |