| 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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 base::TimeTicks::Now() - validated_params.ui_timestamp, | 1214 base::TimeTicks::Now() - validated_params.ui_timestamp, |
| 1215 base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromMinutes(10), | 1215 base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromMinutes(10), |
| 1216 100); | 1216 100); |
| 1217 } | 1217 } |
| 1218 | 1218 |
| 1219 // Attempts to commit certain off-limits URL should be caught more strictly | 1219 // Attempts to commit certain off-limits URL should be caught more strictly |
| 1220 // than our FilterURL checks below. If a renderer violates this policy, it | 1220 // than our FilterURL checks below. If a renderer violates this policy, it |
| 1221 // should be killed. | 1221 // should be killed. |
| 1222 if (!CanCommitURL(validated_params.url)) { | 1222 if (!CanCommitURL(validated_params.url)) { |
| 1223 VLOG(1) << "Blocked URL " << validated_params.url.spec(); | 1223 VLOG(1) << "Blocked URL " << validated_params.url.spec(); |
| 1224 validated_params.url = GURL(url::kAboutBlankURL); | |
| 1225 // Kills the process. | 1224 // Kills the process. |
| 1226 bad_message::ReceivedBadMessage(process, | 1225 bad_message::ReceivedBadMessage(process, |
| 1227 bad_message::RFH_CAN_COMMIT_URL_BLOCKED); | 1226 bad_message::RFH_CAN_COMMIT_URL_BLOCKED); |
| 1228 return; | 1227 return; |
| 1229 } | 1228 } |
| 1230 | 1229 |
| 1231 // Verify that the origin passed from the renderer process is valid and can | 1230 // Verify that the origin passed from the renderer process is valid and can |
| 1232 // be allowed to commit in this RenderFrameHost. | 1231 // be allowed to commit in this RenderFrameHost. |
| 1233 if (!CanCommitOrigin(validated_params.origin, validated_params.url)) { | 1232 if (!CanCommitOrigin(validated_params.origin, validated_params.url)) { |
| 1234 bad_message::ReceivedBadMessage(GetProcess(), | 1233 bad_message::ReceivedBadMessage(GetProcess(), |
| (...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3475 GetUserData(kRenderFrameHostAndroidKey)); | 3474 GetUserData(kRenderFrameHostAndroidKey)); |
| 3476 if (!render_frame_host_android) { | 3475 if (!render_frame_host_android) { |
| 3477 render_frame_host_android = new RenderFrameHostAndroid(this); | 3476 render_frame_host_android = new RenderFrameHostAndroid(this); |
| 3478 SetUserData(kRenderFrameHostAndroidKey, render_frame_host_android); | 3477 SetUserData(kRenderFrameHostAndroidKey, render_frame_host_android); |
| 3479 } | 3478 } |
| 3480 return render_frame_host_android->GetJavaObject(); | 3479 return render_frame_host_android->GetJavaObject(); |
| 3481 } | 3480 } |
| 3482 #endif | 3481 #endif |
| 3483 | 3482 |
| 3484 } // namespace content | 3483 } // namespace content |
| OLD | NEW |