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 14 matching lines...) Expand all Loading... | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef BindingSecurity_h | 31 #ifndef BindingSecurity_h |
| 32 #define BindingSecurity_h | 32 #define BindingSecurity_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "core/dom/ExecutionContext.h" | |
|
Yuki
2016/06/29 00:30:37
Could you use a forward declaration instead?
clas
Gleb Lanbin
2016/06/29 17:07:13
Done.
| |
| 35 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
| 36 #include <v8.h> | 37 #include <v8.h> |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class DOMWindow; | 41 class DOMWindow; |
| 41 class EventTarget; | 42 class EventTarget; |
| 42 class ExceptionState; | 43 class ExceptionState; |
| 43 class Frame; | 44 class Frame; |
| 44 class LocalDOMWindow; | 45 class LocalDOMWindow; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 65 // | 66 // |
| 66 // DOMWindow | 67 // DOMWindow |
| 67 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const DOMWindow* target, ExceptionState&); | 68 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const DOMWindow* target, ExceptionState&); |
| 68 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const DOMWindow* target, SecurityReportingOption); | 69 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const DOMWindow* target, SecurityReportingOption); |
| 69 // EventTarget (as the parent of DOMWindow) | 70 // EventTarget (as the parent of DOMWindow) |
| 70 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const EventTarget* target, ExceptionState&); // NOLINT(readability/par ameter_name) | 71 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const EventTarget* target, ExceptionState&); // NOLINT(readability/par ameter_name) |
| 71 // Location | 72 // Location |
| 72 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Location* target, ExceptionState&); | 73 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Location* target, ExceptionState&); |
| 73 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Location* target, SecurityReportingOption); | 74 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Location* target, SecurityReportingOption); |
| 74 // MainThreadWorkletGlobalScope | 75 // MainThreadWorkletGlobalScope |
| 75 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const MainThreadWorkletGlobalScope* target, SecurityReportingOption); | 76 static bool shouldAllowAccessTo(v8::Isolate*, const v8::Local<v8::Context>&, const ExecutionContext*, const MainThreadWorkletGlobalScope* target, SecurityRe portingOption); |
|
Yuki
2016/06/29 00:30:37
I think
const v8::Local<>&
doesn't make much sen
Gleb Lanbin
2016/06/29 17:07:13
Done.
| |
| 77 | |
| 78 static bool shouldAllowAccessTo(v8::Isolate*, v8::Local<v8::Context> calling , v8::Local<v8::Context> target, SecurityReportingOption); | |
| 76 // Prefer to use the previous overloads instead of falling back to using | 79 // Prefer to use the previous overloads instead of falling back to using |
| 77 // Frame*. | 80 // Frame*. |
| 78 static bool shouldAllowAccessToFrame(v8::Isolate*, const LocalDOMWindow* acc essingWindow, const Frame* target, SecurityReportingOption); // OBSOLETE | 81 static bool shouldAllowAccessToFrame(v8::Isolate*, const LocalDOMWindow* acc essingWindow, const Frame* target, SecurityReportingOption); // OBSOLETE |
| 79 | 82 |
| 80 // Check if the caller (|accessingWindow|) is allowed to access the JS | 83 // Check if the caller (|accessingWindow|) is allowed to access the JS |
| 81 // returned object (|target|), where the returned object is the JS object | 84 // returned object (|target|), where the returned object is the JS object |
| 82 // which is returned as a result of invoking a DOM attribute or DOM | 85 // which is returned as a result of invoking a DOM attribute or DOM |
| 83 // operation (in the form of | 86 // operation (in the form of |
| 84 // var x = receiver.domAttr // or receiver.domOp() | 87 // var x = receiver.domAttr // or receiver.domOp() |
| 85 // where |x| is the returned object). | 88 // where |x| is the returned object). |
| 86 // See window.frameElement for example, which may return a frame object. | 89 // See window.frameElement for example, which may return a frame object. |
| 87 // The object returned from window.frameElement must be the same origin if | 90 // The object returned from window.frameElement must be the same origin if |
| 88 // it's not null. | 91 // it's not null. |
| 89 // | 92 // |
| 90 // Node | 93 // Node |
| 91 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Node* target, ExceptionState&); | 94 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Node* target, ExceptionState&); |
| 92 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Node* target, SecurityReportingOption); | 95 static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessin gWindow, const Node* target, SecurityReportingOption); |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 } // namespace blink | 98 } // namespace blink |
| 96 | 99 |
| 97 #endif | 100 #endif |
| OLD | NEW |