OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return allowed; | 89 return allowed; |
90 } | 90 } |
91 | 91 |
92 bool MixedContentChecker::canRunInsecureContentInternal(SecurityOrigin* security
Origin, const KURL& url, const MixedContentType type) const | 92 bool MixedContentChecker::canRunInsecureContentInternal(SecurityOrigin* security
Origin, const KURL& url, const MixedContentType type) const |
93 { | 93 { |
94 // Check the top frame if it differs from MixedContentChecker's m_frame. | 94 // Check the top frame if it differs from MixedContentChecker's m_frame. |
95 if (!m_frame->tree().top()->isLocalFrame()) { | 95 if (!m_frame->tree().top()->isLocalFrame()) { |
96 // FIXME: We need a way to access the top-level frame's MixedContentChec
ker when that frame | 96 // FIXME: We need a way to access the top-level frame's MixedContentChec
ker when that frame |
97 // is in a different process from the current frame. Until that is done,
we always allow | 97 // is in a different process from the current frame. Until that is done,
we always allow |
98 // loads in remote frames. | 98 // loads in remote frames. |
99 return false; | 99 return true; |
100 } | 100 } |
101 Frame* top = m_frame->tree().top(); | 101 Frame* top = m_frame->tree().top(); |
102 if (top != m_frame && !toLocalFrame(top)->loader().mixedContentChecker()->ca
nRunInsecureContent(toLocalFrame(top)->document()->securityOrigin(), url)) | 102 if (top != m_frame && !toLocalFrame(top)->loader().mixedContentChecker()->ca
nRunInsecureContent(toLocalFrame(top)->document()->securityOrigin(), url)) |
103 return false; | 103 return false; |
104 | 104 |
105 // Then check the current frame: | 105 // Then check the current frame: |
106 if (!isMixedContent(securityOrigin, url)) | 106 if (!isMixedContent(securityOrigin, url)) |
107 return true; | 107 return true; |
108 | 108 |
109 Settings* settings = m_frame->settings(); | 109 Settings* settings = m_frame->settings(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 break; | 165 break; |
166 case Submission: | 166 case Submission: |
167 message.append("is submitting data to an insecure location at '" + targe
t.elidedString() + "': this content should also be submitted over HTTPS.\n"); | 167 message.append("is submitting data to an insecure location at '" + targe
t.elidedString() + "': this content should also be submitted over HTTPS.\n"); |
168 break; | 168 break; |
169 } | 169 } |
170 MessageLevel messageLevel = allowed ? WarningMessageLevel : ErrorMessageLeve
l; | 170 MessageLevel messageLevel = allowed ? WarningMessageLevel : ErrorMessageLeve
l; |
171 m_frame->document()->addConsoleMessage(ConsoleMessage::create(SecurityMessag
eSource, messageLevel, message.toString())); | 171 m_frame->document()->addConsoleMessage(ConsoleMessage::create(SecurityMessag
eSource, messageLevel, message.toString())); |
172 } | 172 } |
173 | 173 |
174 } // namespace blink | 174 } // namespace blink |
OLD | NEW |