OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 ExceptionState& exceptionState, | 47 ExceptionState& exceptionState, |
48 WebURLRequest::RequestContext requestContext) { | 48 WebURLRequest::RequestContext requestContext) { |
49 // FIXME: This should use the dynamic global scope (bug #27887) | 49 // FIXME: This should use the dynamic global scope (bug #27887) |
50 KURL scriptURL = getExecutionContext()->completeURL(url); | 50 KURL scriptURL = getExecutionContext()->completeURL(url); |
51 if (!scriptURL.isValid()) { | 51 if (!scriptURL.isValid()) { |
52 exceptionState.throwDOMException(SyntaxError, | 52 exceptionState.throwDOMException(SyntaxError, |
53 "'" + url + "' is not a valid URL."); | 53 "'" + url + "' is not a valid URL."); |
54 return KURL(); | 54 return KURL(); |
55 } | 55 } |
56 | 56 |
57 // We can safely expose the URL in the following exceptions, as these checks h
appen synchronously before redirection. JavaScript receives no new information. | 57 // We can safely expose the URL in the following exceptions, as these checks |
| 58 // happen synchronously before redirection. JavaScript receives no new |
| 59 // information. |
58 if (!getExecutionContext()->getSecurityOrigin()->canRequestNoSuborigin( | 60 if (!getExecutionContext()->getSecurityOrigin()->canRequestNoSuborigin( |
59 scriptURL)) { | 61 scriptURL)) { |
60 exceptionState.throwSecurityError( | 62 exceptionState.throwSecurityError( |
61 "Script at '" + scriptURL.elidedString() + | 63 "Script at '" + scriptURL.elidedString() + |
62 "' cannot be accessed from origin '" + | 64 "' cannot be accessed from origin '" + |
63 getExecutionContext()->getSecurityOrigin()->toString() + "'."); | 65 getExecutionContext()->getSecurityOrigin()->toString() + "'."); |
64 return KURL(); | 66 return KURL(); |
65 } | 67 } |
66 | 68 |
67 if (getExecutionContext()->contentSecurityPolicy() && | 69 if (getExecutionContext()->contentSecurityPolicy() && |
(...skipping 11 matching lines...) Expand all Loading... |
79 | 81 |
80 return scriptURL; | 82 return scriptURL; |
81 } | 83 } |
82 | 84 |
83 DEFINE_TRACE(AbstractWorker) { | 85 DEFINE_TRACE(AbstractWorker) { |
84 EventTargetWithInlineData::trace(visitor); | 86 EventTargetWithInlineData::trace(visitor); |
85 ActiveDOMObject::trace(visitor); | 87 ActiveDOMObject::trace(visitor); |
86 } | 88 } |
87 | 89 |
88 } // namespace blink | 90 } // namespace blink |
OLD | NEW |