| OLD | NEW |
| 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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 if (!msg_is_ok) { | 835 if (!msg_is_ok) { |
| 836 // The message had a handler, but its deserialization failed. | 836 // The message had a handler, but its deserialization failed. |
| 837 // Kill the renderer to avoid potential spoofing attacks. | 837 // Kill the renderer to avoid potential spoofing attacks. |
| 838 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; | 838 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; |
| 839 } | 839 } |
| 840 | 840 |
| 841 return handled; | 841 return handled; |
| 842 } | 842 } |
| 843 | 843 |
| 844 void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) { | 844 void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) { |
| 845 #if defined(OS_CHROMEOS) |
| 846 // crosbug.com/26646. |
| 847 LOG(ERROR) << "OnNavigate: url=" << params.url |
| 848 << ", webview=" << webview() |
| 849 << ", reload=" << IsReload(params) |
| 850 << ", paerams.state.empty=" << params.state.empty(); |
| 851 #endif |
| 845 MaybeHandleDebugURL(params.url); | 852 MaybeHandleDebugURL(params.url); |
| 846 if (!webview()) | 853 if (!webview()) |
| 847 return; | 854 return; |
| 848 | 855 |
| 849 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); | 856 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); |
| 850 | 857 |
| 851 bool is_reload = IsReload(params); | 858 bool is_reload = IsReload(params); |
| 852 | 859 |
| 853 // If this is a stale back/forward (due to a recent navigation the browser | 860 // If this is a stale back/forward (due to a recent navigation the browser |
| 854 // didn't know about), ignore it. | 861 // didn't know about), ignore it. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 } | 921 } |
| 915 | 922 |
| 916 if (!params.extra_headers.empty()) { | 923 if (!params.extra_headers.empty()) { |
| 917 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), | 924 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), |
| 918 params.extra_headers.end(), "\n"); | 925 params.extra_headers.end(), "\n"); |
| 919 i.GetNext(); ) { | 926 i.GetNext(); ) { |
| 920 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), | 927 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), |
| 921 WebString::fromUTF8(i.values())); | 928 WebString::fromUTF8(i.values())); |
| 922 } | 929 } |
| 923 } | 930 } |
| 924 | 931 #if defined(OS_CHROMEOS) |
| 932 // crosbug.com/26646. |
| 933 LOG(ERROR) << " FrameLoader::loadRequest()"; |
| 934 #endif |
| 925 main_frame->loadRequest(request); | 935 main_frame->loadRequest(request); |
| 926 } | 936 } |
| 927 | 937 |
| 928 // In case LoadRequest failed before DidCreateDataSource was called. | 938 // In case LoadRequest failed before DidCreateDataSource was called. |
| 929 pending_navigation_params_.reset(); | 939 pending_navigation_params_.reset(); |
| 930 } | 940 } |
| 931 | 941 |
| 932 bool RenderViewImpl::IsBackForwardToStaleEntry( | 942 bool RenderViewImpl::IsBackForwardToStaleEntry( |
| 933 const ViewMsg_Navigate_Params& params, | 943 const ViewMsg_Navigate_Params& params, |
| 934 bool is_reload) { | 944 bool is_reload) { |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1623 WebFileChooserCompletion* chooser_completion) { | 1633 WebFileChooserCompletion* chooser_completion) { |
| 1624 int id = enumeration_completion_id_++; | 1634 int id = enumeration_completion_id_++; |
| 1625 enumeration_completions_[id] = chooser_completion; | 1635 enumeration_completions_[id] = chooser_completion; |
| 1626 return Send(new ViewHostMsg_EnumerateDirectory( | 1636 return Send(new ViewHostMsg_EnumerateDirectory( |
| 1627 routing_id_, | 1637 routing_id_, |
| 1628 id, | 1638 id, |
| 1629 webkit_glue::WebStringToFilePath(path))); | 1639 webkit_glue::WebStringToFilePath(path))); |
| 1630 } | 1640 } |
| 1631 | 1641 |
| 1632 void RenderViewImpl::didStartLoading() { | 1642 void RenderViewImpl::didStartLoading() { |
| 1643 #if defined(OS_CHROMEOS) |
| 1644 // crosbug.com/26646. |
| 1645 LOG(ERROR) << "didStartLoading is_loading=" << is_loading_; |
| 1646 #endif |
| 1633 if (is_loading_) { | 1647 if (is_loading_) { |
| 1634 DVLOG(1) << "didStartLoading called while loading"; | 1648 DVLOG(1) << "didStartLoading called while loading"; |
| 1635 return; | 1649 return; |
| 1636 } | 1650 } |
| 1637 | 1651 |
| 1638 is_loading_ = true; | 1652 is_loading_ = true; |
| 1639 | 1653 |
| 1640 Send(new ViewHostMsg_DidStartLoading(routing_id_)); | 1654 Send(new ViewHostMsg_DidStartLoading(routing_id_)); |
| 1641 | 1655 |
| 1642 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading()); | 1656 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading()); |
| (...skipping 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5144 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5158 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5145 return !!RenderThreadImpl::current()->compositor_thread(); | 5159 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5146 } | 5160 } |
| 5147 | 5161 |
| 5148 void RenderViewImpl::OnJavaBridgeInit() { | 5162 void RenderViewImpl::OnJavaBridgeInit() { |
| 5149 DCHECK(!java_bridge_dispatcher_.get()); | 5163 DCHECK(!java_bridge_dispatcher_.get()); |
| 5150 #if defined(ENABLE_JAVA_BRIDGE) | 5164 #if defined(ENABLE_JAVA_BRIDGE) |
| 5151 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5165 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 5152 #endif | 5166 #endif |
| 5153 } | 5167 } |
| OLD | NEW |