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 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 #include "content/common/frame_messages.h" | 54 #include "content/common/frame_messages.h" |
55 #include "content/common/frame_owner_properties.h" | 55 #include "content/common/frame_owner_properties.h" |
56 #include "content/common/frame_replication_state.h" | 56 #include "content/common/frame_replication_state.h" |
57 #include "content/common/gpu/client/context_provider_command_buffer.h" | 57 #include "content/common/gpu/client/context_provider_command_buffer.h" |
58 #include "content/common/input_messages.h" | 58 #include "content/common/input_messages.h" |
59 #include "content/common/navigation_params.h" | 59 #include "content/common/navigation_params.h" |
60 #include "content/common/page_messages.h" | 60 #include "content/common/page_messages.h" |
61 #include "content/common/savable_subframe.h" | 61 #include "content/common/savable_subframe.h" |
62 #include "content/common/service_worker/service_worker_types.h" | 62 #include "content/common/service_worker/service_worker_types.h" |
63 #include "content/common/site_isolation_policy.h" | 63 #include "content/common/site_isolation_policy.h" |
64 #include "content/common/ssl_status_serialization.h" | |
65 #include "content/common/swapped_out_messages.h" | 64 #include "content/common/swapped_out_messages.h" |
66 #include "content/common/view_messages.h" | 65 #include "content/common/view_messages.h" |
67 #include "content/public/common/bindings_policy.h" | 66 #include "content/public/common/bindings_policy.h" |
68 #include "content/public/common/browser_side_navigation_policy.h" | 67 #include "content/public/common/browser_side_navigation_policy.h" |
69 #include "content/public/common/content_constants.h" | 68 #include "content/public/common/content_constants.h" |
70 #include "content/public/common/content_features.h" | 69 #include "content/public/common/content_features.h" |
71 #include "content/public/common/content_switches.h" | 70 #include "content/public/common/content_switches.h" |
72 #include "content/public/common/context_menu_params.h" | 71 #include "content/public/common/context_menu_params.h" |
73 #include "content/public/common/file_chooser_file_info.h" | 72 #include "content/public/common/file_chooser_file_info.h" |
74 #include "content/public/common/file_chooser_params.h" | 73 #include "content/public/common/file_chooser_params.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
778 bool useBinaryEncoding() override { return params_.mhtml_binary_encoding; } | 777 bool useBinaryEncoding() override { return params_.mhtml_binary_encoding; } |
779 | 778 |
780 private: | 779 private: |
781 const FrameMsg_SerializeAsMHTML_Params& params_; | 780 const FrameMsg_SerializeAsMHTML_Params& params_; |
782 std::set<std::string>* digests_of_uris_of_serialized_resources_; | 781 std::set<std::string>* digests_of_uris_of_serialized_resources_; |
783 | 782 |
784 DISALLOW_COPY_AND_ASSIGN(MHTMLPartsGenerationDelegate); | 783 DISALLOW_COPY_AND_ASSIGN(MHTMLPartsGenerationDelegate); |
785 }; | 784 }; |
786 | 785 |
787 // Returns true if a subresource certificate error (described by |url| | 786 // Returns true if a subresource certificate error (described by |url| |
788 // and |security_info|) is "interesting" to the browser process. The | 787 // is "interesting" to the browser process. The browser process is interested |
789 // browser process is interested in certificate errors that differ from | 788 // in certificate errors that differ from certificate errors encountered while |
790 // certificate errors encountered while loading the main frame's main | 789 // loading the main frame's main resource. In other words, it would be confusing |
791 // resource. In other words, it would be confusing to mark a page as | 790 // to mark a page as having displayed/run insecure content when the whole page |
792 // having displayed/run insecure content when the whole page has already | 791 // has already been marked as insecure for the same reason. |
793 // been marked as insecure for the same reason, so subresources with the | |
794 // same certificate errors as the main resource are not sent to the | |
795 // browser process. | |
796 bool IsContentWithCertificateErrorsRelevantToUI( | 792 bool IsContentWithCertificateErrorsRelevantToUI( |
797 blink::WebFrame* frame, | 793 blink::WebFrame* frame, |
798 const blink::WebURL& url, | 794 const blink::WebURL& url, |
799 const blink::WebCString& security_info) { | 795 const blink::WebCString& security_info) { |
800 blink::WebFrame* main_frame = frame->top(); | 796 blink::WebFrame* main_frame = frame->top(); |
801 | 797 |
802 // If the main frame is remote, then it must be cross-site and | 798 // If the main frame is remote, then it must be cross-site and |
803 // therefore this subresource's certificate errors are potentially | 799 // therefore this subresource's certificate errors are potentially |
804 // interesting to the browser (not redundant with the main frame's | 800 // interesting to the browser (not redundant with the main frame's |
805 // main resource). | 801 // main resource). |
806 if (main_frame->isWebRemoteFrame()) | 802 if (main_frame->isWebRemoteFrame()) |
807 return true; | 803 return true; |
808 | 804 |
809 WebDataSource* main_ds = main_frame->toWebLocalFrame()->dataSource(); | 805 WebDataSource* main_ds = main_frame->toWebLocalFrame()->dataSource(); |
810 content::SSLStatus ssl_status; | |
811 content::SSLStatus main_resource_ssl_status; | |
812 CHECK(DeserializeSecurityInfo(security_info, &ssl_status)); | |
813 CHECK(DeserializeSecurityInfo(main_ds->response().securityInfo(), | |
814 &main_resource_ssl_status)); | |
815 | 806 |
816 // Do not send subresource certificate errors if they are the same | 807 // Do not send subresource certificate errors if they are the same |
817 // as errors that occured during the main page load. This compares | 808 // as errors that occured during the main page load. |
818 // most, but not all, fields of SSLStatus. For example, this check | 809 return !url::Origin(GURL(url)).IsSameOriginWith( |
819 // does not compare |content_status| because the navigation entry | 810 url::Origin(GURL(main_ds->request().url()))); |
jam
2016/08/03 19:33:45
I've kept this check because otherwise three SSL b
estark
2016/08/03 22:31:37
Theoretically, checking only the origin could get
jam
2016/08/03 23:55:44
Thanks for the example, I updated the test and rem
| |
820 // might have mixed content but also have the exact same SSL | |
821 // connection properties as the subresource, thereby making the | |
822 // subresource errors duplicative. | |
823 return (!url::Origin(GURL(url)).IsSameOriginWith( | |
824 url::Origin(GURL(main_ds->request().url()))) || | |
825 main_resource_ssl_status.cert_id != ssl_status.cert_id || | |
826 main_resource_ssl_status.cert_status != ssl_status.cert_status || | |
827 main_resource_ssl_status.security_bits != ssl_status.security_bits || | |
828 main_resource_ssl_status.connection_status != | |
829 ssl_status.connection_status); | |
830 } | 811 } |
831 | 812 |
832 bool IsHttpPost(const blink::WebURLRequest& request) { | 813 bool IsHttpPost(const blink::WebURLRequest& request) { |
833 return request.httpMethod().utf8() == "POST"; | 814 return request.httpMethod().utf8() == "POST"; |
834 } | 815 } |
835 | 816 |
836 #if defined(OS_ANDROID) | 817 #if defined(OS_ANDROID) |
837 // Returns true if WMPI should be used for playback, false otherwise. | 818 // Returns true if WMPI should be used for playback, false otherwise. |
838 // | 819 // |
839 // Note that HLS and MP4 detection are pre-redirect and path-based. It is | 820 // Note that HLS and MP4 detection are pre-redirect and path-based. It is |
(...skipping 5505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6345 // event target. Potentially a Pepper plugin will receive the event. | 6326 // event target. Potentially a Pepper plugin will receive the event. |
6346 // In order to tell whether a plugin gets the last mouse event and which it | 6327 // In order to tell whether a plugin gets the last mouse event and which it |
6347 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6328 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6348 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6329 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6349 // |pepper_last_mouse_event_target_|. | 6330 // |pepper_last_mouse_event_target_|. |
6350 pepper_last_mouse_event_target_ = nullptr; | 6331 pepper_last_mouse_event_target_ = nullptr; |
6351 #endif | 6332 #endif |
6352 } | 6333 } |
6353 | 6334 |
6354 } // namespace content | 6335 } // namespace content |
OLD | NEW |