OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 // tab, and we want to still allow that. | 2067 // tab, and we want to still allow that. |
2068 // | 2068 // |
2069 // Note: we do this only for GET requests because our mechanism for switching | 2069 // Note: we do this only for GET requests because our mechanism for switching |
2070 // processes only issues GET requests. In particular, POST requests don't | 2070 // processes only issues GET requests. In particular, POST requests don't |
2071 // work, because this mechanism does not preserve form POST data. If it | 2071 // work, because this mechanism does not preserve form POST data. If it |
2072 // becomes necessary to support process switching for POST requests, we will | 2072 // becomes necessary to support process switching for POST requests, we will |
2073 // need to send the request's httpBody data up to the browser process, and | 2073 // need to send the request's httpBody data up to the browser process, and |
2074 // issue a special POST navigation in WebKit (via | 2074 // issue a special POST navigation in WebKit (via |
2075 // FrameLoader::loadFrameRequest). See ResourceDispatcher and WebURLLoaderImpl | 2075 // FrameLoader::loadFrameRequest). See ResourceDispatcher and WebURLLoaderImpl |
2076 // for examples of how to send the httpBody data. | 2076 // for examples of how to send the httpBody data. |
2077 if (!frame->parent() && is_content_initiated && | 2077 // TODO(mpcomplete): remove is_redirect clause when http://crbug.com/79520 is |
| 2078 // fixed. |
| 2079 if (!frame->parent() && (is_content_initiated || is_redirect) && |
2078 default_policy == WebKit::WebNavigationPolicyCurrentTab && | 2080 default_policy == WebKit::WebNavigationPolicyCurrentTab && |
2079 request.httpMethod() == "GET" && !url.SchemeIs(chrome::kAboutScheme)) { | 2081 request.httpMethod() == "GET" && !url.SchemeIs(chrome::kAboutScheme)) { |
2080 bool send_referrer = false; | 2082 bool send_referrer = false; |
2081 bool should_fork = | 2083 bool should_fork = |
2082 (enabled_bindings_ & content::BINDINGS_POLICY_WEB_UI) || | 2084 (enabled_bindings_ & content::BINDINGS_POLICY_WEB_UI) || |
2083 frame->isViewSourceModeEnabled() || | 2085 frame->isViewSourceModeEnabled() || |
2084 url.SchemeIs(chrome::kViewSourceScheme); | 2086 url.SchemeIs(chrome::kViewSourceScheme); |
2085 | 2087 |
2086 if (!should_fork) { | 2088 if (!should_fork) { |
2087 // Give the embedder a chance. | 2089 // Give the embedder a chance. |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4789 return !!RenderThreadImpl::current()->compositor_thread(); | 4791 return !!RenderThreadImpl::current()->compositor_thread(); |
4790 } | 4792 } |
4791 | 4793 |
4792 void RenderViewImpl::OnJavaBridgeInit( | 4794 void RenderViewImpl::OnJavaBridgeInit( |
4793 const IPC::ChannelHandle& channel_handle) { | 4795 const IPC::ChannelHandle& channel_handle) { |
4794 DCHECK(!java_bridge_dispatcher_.get()); | 4796 DCHECK(!java_bridge_dispatcher_.get()); |
4795 #if defined(ENABLE_JAVA_BRIDGE) | 4797 #if defined(ENABLE_JAVA_BRIDGE) |
4796 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4798 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4797 #endif | 4799 #endif |
4798 } | 4800 } |
OLD | NEW |