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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 // If the navigation is browser-initiated, the NavigationState contains the | 2683 // If the navigation is browser-initiated, the NavigationState contains the |
2684 // correct value instead of the WebDataSource. | 2684 // correct value instead of the WebDataSource. |
2685 // | 2685 // |
2686 // TODO(davidben): Avoid this awkward duplication of state. See comment on | 2686 // TODO(davidben): Avoid this awkward duplication of state. See comment on |
2687 // NavigationState::should_replace_current_entry(). | 2687 // NavigationState::should_replace_current_entry(). |
2688 should_replace_current_entry = | 2688 should_replace_current_entry = |
2689 navigation_state->should_replace_current_entry(); | 2689 navigation_state->should_replace_current_entry(); |
2690 } | 2690 } |
2691 | 2691 |
2692 int provider_id = kInvalidServiceWorkerProviderId; | 2692 int provider_id = kInvalidServiceWorkerProviderId; |
2693 if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel || | 2693 if (!request.skipServiceWorker()) { |
2694 request.frameType() == blink::WebURLRequest::FrameTypeNested) { | 2694 if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel || |
2695 // |provisionalDataSource| may be null in some content::ResourceFetcher | 2695 request.frameType() == blink::WebURLRequest::FrameTypeNested) { |
2696 // use cases, we don't hook those requests. | 2696 // |provisionalDataSource| may be null in some content::ResourceFetcher |
2697 if (frame->provisionalDataSource()) { | 2697 // use cases, we don't hook those requests. |
| 2698 if (frame->provisionalDataSource()) { |
| 2699 ServiceWorkerNetworkProvider* provider = |
| 2700 ServiceWorkerNetworkProvider::FromDocumentState( |
| 2701 DocumentState::FromDataSource(frame->provisionalDataSource())); |
| 2702 provider_id = provider->provider_id(); |
| 2703 } |
| 2704 } else if (frame->dataSource()) { |
2698 ServiceWorkerNetworkProvider* provider = | 2705 ServiceWorkerNetworkProvider* provider = |
2699 ServiceWorkerNetworkProvider::FromDocumentState( | 2706 ServiceWorkerNetworkProvider::FromDocumentState( |
2700 DocumentState::FromDataSource(frame->provisionalDataSource())); | 2707 DocumentState::FromDataSource(frame->dataSource())); |
2701 provider_id = provider->provider_id(); | 2708 provider_id = provider->provider_id(); |
2702 } | 2709 } |
2703 } else if (frame->dataSource()) { | |
2704 ServiceWorkerNetworkProvider* provider = | |
2705 ServiceWorkerNetworkProvider::FromDocumentState( | |
2706 DocumentState::FromDataSource(frame->dataSource())); | |
2707 provider_id = provider->provider_id(); | |
2708 } | 2710 } |
2709 | 2711 |
2710 WebFrame* parent = frame->parent(); | 2712 WebFrame* parent = frame->parent(); |
2711 int parent_routing_id = MSG_ROUTING_NONE; | 2713 int parent_routing_id = MSG_ROUTING_NONE; |
2712 if (!parent) { | 2714 if (!parent) { |
2713 parent_routing_id = -1; | 2715 parent_routing_id = -1; |
2714 } else if (parent->isWebLocalFrame()) { | 2716 } else if (parent->isWebLocalFrame()) { |
2715 parent_routing_id = FromWebFrame(parent)->GetRoutingID(); | 2717 parent_routing_id = FromWebFrame(parent)->GetRoutingID(); |
2716 } else { | 2718 } else { |
2717 parent_routing_id = RenderFrameProxy::FromWebFrame(parent)->routing_id(); | 2719 parent_routing_id = RenderFrameProxy::FromWebFrame(parent)->routing_id(); |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3849 | 3851 |
3850 #if defined(ENABLE_BROWSER_CDMS) | 3852 #if defined(ENABLE_BROWSER_CDMS) |
3851 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3853 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3852 if (!cdm_manager_) | 3854 if (!cdm_manager_) |
3853 cdm_manager_ = new RendererCdmManager(this); | 3855 cdm_manager_ = new RendererCdmManager(this); |
3854 return cdm_manager_; | 3856 return cdm_manager_; |
3855 } | 3857 } |
3856 #endif // defined(ENABLE_BROWSER_CDMS) | 3858 #endif // defined(ENABLE_BROWSER_CDMS) |
3857 | 3859 |
3858 } // namespace content | 3860 } // namespace content |
OLD | NEW |