| 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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 void RenderViewHostImpl::SyncRendererPrefs() { | 301 void RenderViewHostImpl::SyncRendererPrefs() { |
| 302 Send(new ViewMsg_SetRendererPrefs(GetRoutingID(), | 302 Send(new ViewMsg_SetRendererPrefs(GetRoutingID(), |
| 303 delegate_->GetRendererPrefs( | 303 delegate_->GetRendererPrefs( |
| 304 GetProcess()->GetBrowserContext()))); | 304 GetProcess()->GetBrowserContext()))); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void RenderViewHostImpl::Navigate(const ViewMsg_Navigate_Params& params) { | 307 void RenderViewHostImpl::Navigate(const ViewMsg_Navigate_Params& params) { |
| 308 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( | 308 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
| 309 GetProcess()->GetID(), params.url); | 309 GetProcess()->GetID(), params.url); |
| 310 if (params.url.SchemeIs(chrome::kDataScheme) && |
| 311 params.base_url_for_data_url.SchemeIs(chrome::kFileScheme)) { |
| 312 // If 'data:' is used, and we have a 'file:' base url, grant access to |
| 313 // local files. |
| 314 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( |
| 315 GetProcess()->GetID(), params.base_url_for_data_url); |
| 316 } |
| 310 | 317 |
| 311 ViewMsg_Navigate* nav_message = new ViewMsg_Navigate(GetRoutingID(), params); | 318 ViewMsg_Navigate* nav_message = new ViewMsg_Navigate(GetRoutingID(), params); |
| 312 | 319 |
| 313 // Only send the message if we aren't suspended at the start of a cross-site | 320 // Only send the message if we aren't suspended at the start of a cross-site |
| 314 // request. | 321 // request. |
| 315 if (navigations_suspended_) { | 322 if (navigations_suspended_) { |
| 316 // Shouldn't be possible to have a second navigation while suspended, since | 323 // Shouldn't be possible to have a second navigation while suspended, since |
| 317 // navigations will only be suspended during a cross-site request. If a | 324 // navigations will only be suspended during a cross-site request. If a |
| 318 // second navigation occurs, WebContentsImpl will cancel this pending RVH | 325 // second navigation occurs, WebContentsImpl will cancel this pending RVH |
| 319 // create a new pending RVH. | 326 // create a new pending RVH. |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 // can cause navigations to be ignored in OnMsgNavigate. | 1881 // can cause navigations to be ignored in OnMsgNavigate. |
| 1875 is_waiting_for_beforeunload_ack_ = false; | 1882 is_waiting_for_beforeunload_ack_ = false; |
| 1876 is_waiting_for_unload_ack_ = false; | 1883 is_waiting_for_unload_ack_ = false; |
| 1877 } | 1884 } |
| 1878 | 1885 |
| 1879 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1886 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1880 STLDeleteValues(&power_save_blockers_); | 1887 STLDeleteValues(&power_save_blockers_); |
| 1881 } | 1888 } |
| 1882 | 1889 |
| 1883 } // namespace content | 1890 } // namespace content |
| OLD | NEW |