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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/child/appcache_dispatcher.h" | 9 #include "content/child/appcache_dispatcher.h" |
10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "third_party/WebKit/public/web/WebFileSystemCallbacks.h" | 39 #include "third_party/WebKit/public/web/WebFileSystemCallbacks.h" |
40 #include "third_party/WebKit/public/web/WebFrame.h" | 40 #include "third_party/WebKit/public/web/WebFrame.h" |
41 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 41 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
42 #include "third_party/WebKit/public/web/WebPlugin.h" | 42 #include "third_party/WebKit/public/web/WebPlugin.h" |
43 #include "third_party/WebKit/public/web/WebPluginParams.h" | 43 #include "third_party/WebKit/public/web/WebPluginParams.h" |
44 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 44 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
45 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 45 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
46 #include "third_party/WebKit/public/web/WebStorageQuotaCallbacks.h" | 46 #include "third_party/WebKit/public/web/WebStorageQuotaCallbacks.h" |
47 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 47 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
48 #include "third_party/WebKit/public/web/WebView.h" | 48 #include "third_party/WebKit/public/web/WebView.h" |
| 49 #include "webkit/child/site_isolation_policy.h" |
49 #include "webkit/child/weburlresponse_extradata_impl.h" | 50 #include "webkit/child/weburlresponse_extradata_impl.h" |
50 | 51 |
51 using WebKit::WebDataSource; | 52 using WebKit::WebDataSource; |
52 using WebKit::WebDocument; | 53 using WebKit::WebDocument; |
53 using WebKit::WebFileSystemCallbacks; | 54 using WebKit::WebFileSystemCallbacks; |
54 using WebKit::WebFrame; | 55 using WebKit::WebFrame; |
55 using WebKit::WebNavigationPolicy; | 56 using WebKit::WebNavigationPolicy; |
56 using WebKit::WebPluginParams; | 57 using WebKit::WebPluginParams; |
57 using WebKit::WebReferrerPolicy; | 58 using WebKit::WebReferrerPolicy; |
58 using WebKit::WebSearchableFormData; | 59 using WebKit::WebSearchableFormData; |
59 using WebKit::WebSecurityOrigin; | 60 using WebKit::WebSecurityOrigin; |
60 using WebKit::WebStorageQuotaCallbacks; | 61 using WebKit::WebStorageQuotaCallbacks; |
61 using WebKit::WebString; | 62 using WebKit::WebString; |
62 using WebKit::WebURL; | 63 using WebKit::WebURL; |
63 using WebKit::WebURLError; | 64 using WebKit::WebURLError; |
64 using WebKit::WebURLRequest; | 65 using WebKit::WebURLRequest; |
65 using WebKit::WebURLResponse; | 66 using WebKit::WebURLResponse; |
66 using WebKit::WebUserGestureIndicator; | 67 using WebKit::WebUserGestureIndicator; |
67 using WebKit::WebVector; | 68 using WebKit::WebVector; |
68 using WebKit::WebView; | 69 using WebKit::WebView; |
69 | 70 |
70 using appcache::WebApplicationCacheHostImpl; | 71 using appcache::WebApplicationCacheHostImpl; |
71 using base::Time; | 72 using base::Time; |
72 using base::TimeDelta; | 73 using base::TimeDelta; |
73 | 74 |
74 using webkit_glue::WebURLResponseExtraDataImpl; | 75 using webkit_glue::WebURLResponseExtraDataImpl; |
| 76 using webkit_glue::SiteIsolationPolicy; |
75 | 77 |
76 namespace content { | 78 namespace content { |
77 | 79 |
78 static RenderFrameImpl* (*g_create_render_frame_impl)(RenderViewImpl*, int32) = | 80 static RenderFrameImpl* (*g_create_render_frame_impl)(RenderViewImpl*, int32) = |
79 NULL; | 81 NULL; |
80 | 82 |
81 // static | 83 // static |
82 RenderFrameImpl* RenderFrameImpl::Create( | 84 RenderFrameImpl* RenderFrameImpl::Create( |
83 RenderViewImpl* render_view, | 85 RenderViewImpl* render_view, |
84 int32 routing_id) { | 86 int32 routing_id) { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 navigation_state->extra_headers().begin(), | 598 navigation_state->extra_headers().begin(), |
597 navigation_state->extra_headers().end(), "\n"); | 599 navigation_state->extra_headers().end(), "\n"); |
598 i.GetNext(); ) { | 600 i.GetNext(); ) { |
599 request.setHTTPHeaderField(WebString::fromUTF8(i.name()), | 601 request.setHTTPHeaderField(WebString::fromUTF8(i.name()), |
600 WebString::fromUTF8(i.values())); | 602 WebString::fromUTF8(i.values())); |
601 } | 603 } |
602 } | 604 } |
603 | 605 |
604 if (!render_view_->renderer_preferences_.enable_referrers) | 606 if (!render_view_->renderer_preferences_.enable_referrers) |
605 request.clearHTTPHeaderField("Referer"); | 607 request.clearHTTPHeaderField("Referer"); |
| 608 |
| 609 SiteIsolationPolicy::WillSendRequest(identifier, request.targetType()); |
606 } | 610 } |
607 | 611 |
608 void RenderFrameImpl::didReceiveResponse( | 612 void RenderFrameImpl::didReceiveResponse( |
609 WebKit::WebFrame* frame, | 613 WebKit::WebFrame* frame, |
610 unsigned identifier, | 614 unsigned identifier, |
611 const WebKit::WebURLResponse& response) { | 615 const WebKit::WebURLResponse& response) { |
| 616 |
| 617 SiteIsolationPolicy::DidReceiveResponse(frame, identifier, response); |
| 618 |
612 // Only do this for responses that correspond to a provisional data source | 619 // Only do this for responses that correspond to a provisional data source |
613 // of the top-most frame. If we have a provisional data source, then we | 620 // of the top-most frame. If we have a provisional data source, then we |
614 // can't have any sub-resources yet, so we know that this response must | 621 // can't have any sub-resources yet, so we know that this response must |
615 // correspond to a frame load. | 622 // correspond to a frame load. |
616 if (!frame->provisionalDataSource() || frame->parent()) | 623 if (!frame->provisionalDataSource() || frame->parent()) |
617 return; | 624 return; |
618 | 625 |
619 // If we are in view source mode, then just let the user see the source of | 626 // If we are in view source mode, then just let the user see the source of |
620 // the server's error page. | 627 // the server's error page. |
621 if (frame->isViewSourceModeEnabled()) | 628 if (frame->isViewSourceModeEnabled()) |
(...skipping 29 matching lines...) Expand all Loading... |
651 internal_data->set_use_error_page(true); | 658 internal_data->set_use_error_page(true); |
652 } | 659 } |
653 | 660 |
654 void RenderFrameImpl::didFinishResourceLoad(WebKit::WebFrame* frame, | 661 void RenderFrameImpl::didFinishResourceLoad(WebKit::WebFrame* frame, |
655 unsigned identifier) { | 662 unsigned identifier) { |
656 // TODO(nasko): Move implementation here. Needed state: | 663 // TODO(nasko): Move implementation here. Needed state: |
657 // * devtools_agent_ | 664 // * devtools_agent_ |
658 // Needed methods: | 665 // Needed methods: |
659 // * LoadNavigationErrorPage | 666 // * LoadNavigationErrorPage |
660 render_view_->didFinishResourceLoad(frame, identifier); | 667 render_view_->didFinishResourceLoad(frame, identifier); |
| 668 |
| 669 SiteIsolationPolicy::DidFinishResourceLoad(identifier); |
661 } | 670 } |
662 | 671 |
663 void RenderFrameImpl::didLoadResourceFromMemoryCache( | 672 void RenderFrameImpl::didLoadResourceFromMemoryCache( |
664 WebKit::WebFrame* frame, | 673 WebKit::WebFrame* frame, |
665 const WebKit::WebURLRequest& request, | 674 const WebKit::WebURLRequest& request, |
666 const WebKit::WebURLResponse& response) { | 675 const WebKit::WebURLResponse& response) { |
667 // The recipients of this message have no use for data: URLs: they don't | 676 // The recipients of this message have no use for data: URLs: they don't |
668 // affect the page's insecure content list and are not in the disk cache. To | 677 // affect the page's insecure content list and are not in the disk cache. To |
669 // prevent large (1M+) data: URLs from crashing in the IPC system, we simply | 678 // prevent large (1M+) data: URLs from crashing in the IPC system, we simply |
670 // filter them out here. | 679 // filter them out here. |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 905 |
897 void RenderFrameImpl::didLoseWebGLContext(WebKit::WebFrame* frame, | 906 void RenderFrameImpl::didLoseWebGLContext(WebKit::WebFrame* frame, |
898 int arb_robustness_status_code) { | 907 int arb_robustness_status_code) { |
899 Send(new ViewHostMsg_DidLose3DContext( | 908 Send(new ViewHostMsg_DidLose3DContext( |
900 GURL(frame->top()->document().securityOrigin().toString()), | 909 GURL(frame->top()->document().securityOrigin().toString()), |
901 THREE_D_API_TYPE_WEBGL, | 910 THREE_D_API_TYPE_WEBGL, |
902 arb_robustness_status_code)); | 911 arb_robustness_status_code)); |
903 } | 912 } |
904 | 913 |
905 } // namespace content | 914 } // namespace content |
OLD | NEW |