Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h |
| index f8fbe354caff51b25d157eae0ebc90d5296f1076..68b14f87be782d1b9f6040f14f30c6242bcebd47 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h |
| @@ -31,16 +31,18 @@ |
| #ifndef BindingSecurity_h |
| #define BindingSecurity_h |
| -// FIXME: The LocalFrame include should not be necessary, clients should be including it where they use it. |
| #include "core/CoreExport.h" |
| -#include "core/frame/LocalFrame.h" |
| #include "wtf/Allocator.h" |
| #include <v8.h> |
| namespace blink { |
| -class LocalDOMWindow; |
| +class DOMWindow; |
| +class EventTarget; |
| class ExceptionState; |
| +class Frame; |
| +class LocalDOMWindow; |
| +class Location; |
| class Node; |
| enum SecurityReportingOption { |
| @@ -51,15 +53,26 @@ enum SecurityReportingOption { |
| class BindingSecurity { |
|
haraken
2015/11/16 11:34:20
Add CORE_EXPORT to the class (and remove CORE_EXPO
Yuki
2015/11/20 12:27:52
Done.
|
| STATIC_ONLY(BindingSecurity); |
| public: |
| + // Check the access to the receiver. |
|
haraken
2015/11/16 11:34:20
// Check if the receiver is allowed to access the
dcheng
2015/11/17 01:56:59
Can we clarify the comments to define what "receiv
Yuki
2015/11/20 12:27:52
I rewrote the comment in a little bit different wa
Yuki
2015/11/20 12:27:52
Done.
|
| + // DOMWindow |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const DOMWindow* target, ExceptionState&); |
|
jochen (gone - plz use gerrit)
2015/11/16 14:16:58
should we encode what the method does in the name
Yuki
2015/11/20 12:27:52
I agree that we'd better to encode what the method
|
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const DOMWindow* target, SecurityReportingOption); |
| + // EventTarget (as the parent of DOMWindow) |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const EventTarget* target, ExceptionState&); // NOLINT(readability/parameter_name) |
|
haraken
2015/11/16 11:34:20
I'm just curious but how much is the EventTarget*
Yuki
2015/11/20 12:27:52
The generated V8EventTarget.cpp needs the EventTar
|
| + // Location |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const Location* target, ExceptionState&); |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const Location* target, SecurityReportingOption); |
| + |
| // Check the access to the return value. |
|
dcheng
2015/11/17 01:56:59
and "access to the return value". I'm not super fa
Yuki
2015/11/20 12:27:52
Done.
|
| - static bool shouldAllowAccessToNode(v8::Isolate*, LocalDOMWindow* accessingWindow, Node*, SecurityReportingOption); |
| - static bool shouldAllowAccessToNode(v8::Isolate*, LocalDOMWindow* accessingWindow, Node*, ExceptionState&); |
| + // Node |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const Node* target, ExceptionState&); |
| + CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const Node* target, SecurityReportingOption); |
| - // Check the access to the receiver. |
| - CORE_EXPORT static bool shouldAllowAccessToFrame(v8::Isolate*, LocalDOMWindow* accessingWindow, Frame*, SecurityReportingOption = ReportSecurityError); |
| - CORE_EXPORT static bool shouldAllowAccessToFrame(v8::Isolate*, LocalDOMWindow* accessingWindow, Frame*, ExceptionState&); |
| + // Check the access to the frame rather than to a DOM object. |
|
haraken
2015/11/16 11:34:20
DOM object => DOMWindow/EventTarget/Location
Yuki
2015/11/20 12:27:52
Done.
|
| + // You should check the access to the DOM object as long as it's possible. |
|
dcheng
2015/11/17 01:56:59
Nit: reword this as "Prefer to use the previous ov
Yuki
2015/11/20 12:27:52
Done.
|
| + CORE_EXPORT static bool shouldAllowAccessToFrame(v8::Isolate*, const LocalDOMWindow* accessingWindow, const Frame*, SecurityReportingOption); |
|
haraken
2015/11/16 11:34:20
const Frame* target
dcheng
2015/11/17 01:56:59
This is a 'receiver' method, right? Should it be g
Yuki
2015/11/20 12:27:52
Done.
Yuki
2015/11/20 12:27:52
Done.
|
| }; |
| -} |
| +} // namespace blink |
| #endif |