Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 const Frame* target, | 111 const Frame* target, |
| 112 ErrorReportOption); | 112 ErrorReportOption); |
| 113 // This overload must be used only for detached windows. | 113 // This overload must be used only for detached windows. |
| 114 static bool shouldAllowAccessToDetachedWindow( | 114 static bool shouldAllowAccessToDetachedWindow( |
| 115 const LocalDOMWindow* accessingWindow, | 115 const LocalDOMWindow* accessingWindow, |
| 116 const DOMWindow* target, | 116 const DOMWindow* target, |
| 117 ExceptionState&); | 117 ExceptionState&); |
| 118 | 118 |
| 119 static void failedAccessCheckFor(v8::Isolate*, const Frame* target); | 119 static void failedAccessCheckFor(v8::Isolate*, const Frame* target); |
| 120 | 120 |
| 121 // Returns true if the creation context can be entered from the current | |
| 122 // context. If the creation context cannot be entered, a security error is | |
| 123 // thrown and this method returns false. | |
| 124 static bool canEnterCreationContext(v8::Isolate*, | |
|
Yuki
2017/03/16 14:05:55
Do you really want to expose this function in publ
adithyas
2017/03/28 20:35:41
Nope, made it private.
| |
| 125 v8::Local<v8::Context> currentContext, | |
| 126 v8::Local<v8::Context> creationContext, | |
| 127 const char* interfaceName); | |
| 128 | |
| 129 static void securityCheckForClassesWithAccessCheckCallbacks( | |
|
Yuki
2017/03/16 14:05:55
Does "Classes" here mean IDL interface? If so, it
adithyas
2017/03/28 20:35:40
Yes, I meant IDL interface here and not a C++ clas
| |
| 130 v8::Isolate*, | |
| 131 v8::Local<v8::Context> currentContext, | |
| 132 v8::Local<v8::Context> creationContext, | |
| 133 const char* interfaceName, | |
| 134 v8::Local<v8::Value> crossContextException); | |
| 135 | |
| 136 static void securityCheckForClassesWithoutAccessCheckCallbacks( | |
| 137 v8::Isolate*, | |
| 138 v8::Local<v8::Context> currentContext, | |
| 139 v8::Local<v8::Context> creationContext, | |
| 140 const char* interfaceName, | |
| 141 v8::Local<v8::Value> crossContextException); | |
| 142 | |
| 121 private: | 143 private: |
| 122 // Returns true if |accessingWindow| is allowed named access to |targetWindow| | 144 // Returns true if |accessingWindow| is allowed named access to |targetWindow| |
| 123 // because they're the same origin. Note that named access should be allowed | 145 // because they're the same origin. Note that named access should be allowed |
| 124 // even if they're cross origin as long as the browsing context name matches | 146 // even if they're cross origin as long as the browsing context name matches |
| 125 // the browsing context container's name. | 147 // the browsing context container's name. |
| 126 // | 148 // |
| 127 // Unlike shouldAllowAccessTo, this function returns true even when | 149 // Unlike shouldAllowAccessTo, this function returns true even when |
| 128 // |accessingWindow| or |targetWindow| is a RemoteDOMWindow, but remember that | 150 // |accessingWindow| or |targetWindow| is a RemoteDOMWindow, but remember that |
| 129 // only limited operations are allowed on a RemoteDOMWindow. | 151 // only limited operations are allowed on a RemoteDOMWindow. |
| 130 // | 152 // |
| 131 // This function should be only used from V8Window::namedPropertyGetterCustom. | 153 // This function should be only used from V8Window::namedPropertyGetterCustom. |
| 132 friend class V8Window; | 154 friend class V8Window; |
| 133 static bool shouldAllowNamedAccessTo(const DOMWindow* accessingWindow, | 155 static bool shouldAllowNamedAccessTo(const DOMWindow* accessingWindow, |
| 134 const DOMWindow* targetWindow); | 156 const DOMWindow* targetWindow); |
| 135 }; | 157 }; |
| 136 | 158 |
| 137 } // namespace blink | 159 } // namespace blink |
| 138 | 160 |
| 139 #endif // BindingSecurity_h | 161 #endif // BindingSecurity_h |
| OLD | NEW |