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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1976 ServiceWorkerNetworkProvider* provider = | 1976 ServiceWorkerNetworkProvider* provider = |
1977 ServiceWorkerNetworkProvider::FromDocumentState( | 1977 ServiceWorkerNetworkProvider::FromDocumentState( |
1978 DocumentState::FromDataSource(frame->dataSource())); | 1978 DocumentState::FromDataSource(frame->dataSource())); |
1979 return new WebServiceWorkerProviderImpl( | 1979 return new WebServiceWorkerProviderImpl( |
1980 ChildThread::current()->thread_safe_sender(), | 1980 ChildThread::current()->thread_safe_sender(), |
1981 provider ? provider->context() : NULL); | 1981 provider ? provider->context() : NULL); |
1982 } | 1982 } |
1983 | 1983 |
1984 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { | 1984 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { |
1985 DCHECK(!frame_ || frame_ == frame); | 1985 DCHECK(!frame_ || frame_ == frame); |
1986 // If the request hasn't yet committed, notify the browser process that it is | 1986 // Notify the browser process that it is no longer safe to show the pending |
1987 // no longer safe to show the pending URL of the main frame, since a URL spoof | 1987 // URL of the main frame, since a URL spoof is now possible. |
1988 // is now possible. (If the request has committed, the browser already knows.) | 1988 if (!frame->parent() && render_view_->page_id_ == -1) |
1989 if (!frame->parent()) { | 1989 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_)); |
1990 DocumentState* document_state = | |
1991 DocumentState::FromDataSource(frame->dataSource()); | |
1992 NavigationState* navigation_state = document_state->navigation_state(); | |
1993 | |
1994 if (!navigation_state->request_committed()) { | |
1995 Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_)); | |
1996 } | |
1997 } | |
1998 } | 1990 } |
1999 | 1991 |
2000 // TODO(alexmos): Remove once Blink is updated to use the version that takes | 1992 // TODO(alexmos): Remove once Blink is updated to use the version that takes |
2001 // sandbox flags. | 1993 // sandbox flags. |
2002 blink::WebFrame* RenderFrameImpl::createChildFrame( | 1994 blink::WebFrame* RenderFrameImpl::createChildFrame( |
2003 blink::WebLocalFrame* parent, | 1995 blink::WebLocalFrame* parent, |
2004 const blink::WebString& name) { | 1996 const blink::WebString& name) { |
2005 return createChildFrame(parent, name, blink::WebSandboxFlags::None); | 1997 return createChildFrame(parent, name, blink::WebSandboxFlags::None); |
2006 } | 1998 } |
2007 | 1999 |
(...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4402 | 4394 |
4403 #if defined(ENABLE_BROWSER_CDMS) | 4395 #if defined(ENABLE_BROWSER_CDMS) |
4404 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4396 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4405 if (!cdm_manager_) | 4397 if (!cdm_manager_) |
4406 cdm_manager_ = new RendererCdmManager(this); | 4398 cdm_manager_ = new RendererCdmManager(this); |
4407 return cdm_manager_; | 4399 return cdm_manager_; |
4408 } | 4400 } |
4409 #endif // defined(ENABLE_BROWSER_CDMS) | 4401 #endif // defined(ENABLE_BROWSER_CDMS) |
4410 | 4402 |
4411 } // namespace content | 4403 } // namespace content |
OLD | NEW |