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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 ServiceWorkerNetworkProvider* provider = | 2014 ServiceWorkerNetworkProvider* provider = |
2015 ServiceWorkerNetworkProvider::FromDocumentState( | 2015 ServiceWorkerNetworkProvider::FromDocumentState( |
2016 DocumentState::FromDataSource(frame->dataSource())); | 2016 DocumentState::FromDataSource(frame->dataSource())); |
2017 return new WebServiceWorkerProviderImpl( | 2017 return new WebServiceWorkerProviderImpl( |
2018 ChildThread::current()->thread_safe_sender(), | 2018 ChildThread::current()->thread_safe_sender(), |
2019 provider ? provider->context() : NULL); | 2019 provider ? provider->context() : NULL); |
2020 } | 2020 } |
2021 | 2021 |
2022 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { | 2022 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { |
2023 DCHECK(!frame_ || frame_ == frame); | 2023 DCHECK(!frame_ || frame_ == frame); |
2024 // Notify the browser process that it is no longer safe to show the pending | 2024 // If the request hasn't yet committed, notify the browser process that it is |
2025 // URL of the main frame, since a URL spoof is now possible. | 2025 // no longer safe to show the pending URL of the main frame, since a URL spoof |
2026 if (!frame->parent() && render_view_->page_id_ == -1) | 2026 // is now possible. (If the request has committed, the browser already knows.) |
2027 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_)); | 2027 if (!frame->parent()) { |
| 2028 DocumentState* document_state = |
| 2029 DocumentState::FromDataSource(frame->dataSource()); |
| 2030 NavigationState* navigation_state = document_state->navigation_state(); |
| 2031 |
| 2032 if (!navigation_state->request_committed()) { |
| 2033 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_)); |
| 2034 } |
| 2035 } |
2028 } | 2036 } |
2029 | 2037 |
2030 // TODO(alexmos): Remove once Blink is updated to use the version that takes | 2038 // TODO(alexmos): Remove once Blink is updated to use the version that takes |
2031 // sandbox flags. | 2039 // sandbox flags. |
2032 blink::WebFrame* RenderFrameImpl::createChildFrame( | 2040 blink::WebFrame* RenderFrameImpl::createChildFrame( |
2033 blink::WebLocalFrame* parent, | 2041 blink::WebLocalFrame* parent, |
2034 const blink::WebString& name) { | 2042 const blink::WebString& name) { |
2035 return createChildFrame(parent, name, blink::WebSandboxFlags::None); | 2043 return createChildFrame(parent, name, blink::WebSandboxFlags::None); |
2036 } | 2044 } |
2037 | 2045 |
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4440 | 4448 |
4441 #if defined(ENABLE_BROWSER_CDMS) | 4449 #if defined(ENABLE_BROWSER_CDMS) |
4442 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4450 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4443 if (!cdm_manager_) | 4451 if (!cdm_manager_) |
4444 cdm_manager_ = new RendererCdmManager(this); | 4452 cdm_manager_ = new RendererCdmManager(this); |
4445 return cdm_manager_; | 4453 return cdm_manager_; |
4446 } | 4454 } |
4447 #endif // defined(ENABLE_BROWSER_CDMS) | 4455 #endif // defined(ENABLE_BROWSER_CDMS) |
4448 | 4456 |
4449 } // namespace content | 4457 } // namespace content |
OLD | NEW |