Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/Source/core/frame/Location.h

Issue 2640123006: Use the current context as the creation context for cross-origin objects. (Closed)
Patch Set: Tweak Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple 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 16 matching lines...) Expand all
27 */ 27 */
28 28
29 #ifndef Location_h 29 #ifndef Location_h
30 #define Location_h 30 #define Location_h
31 31
32 #include "bindings/core/v8/ScriptValue.h" 32 #include "bindings/core/v8/ScriptValue.h"
33 #include "bindings/core/v8/ScriptWrappable.h" 33 #include "bindings/core/v8/ScriptWrappable.h"
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/dom/DOMStringList.h" 35 #include "core/dom/DOMStringList.h"
36 #include "wtf/text/WTFString.h" 36 #include "wtf/text/WTFString.h"
37 #include <v8/include/v8.h>
37 38
38 namespace blink { 39 namespace blink {
39 40
40 class LocalDOMWindow; 41 class LocalDOMWindow;
41 class ExceptionState; 42 class ExceptionState;
42 class Frame; 43 class Frame;
43 class KURL; 44 class KURL;
44 45
45 // This class corresponds to the JS Location API, which is the only DOM API 46 // This class corresponds to the JS Location API, which is the only DOM API
46 // besides Window that is operable in a RemoteFrame. Location needs to be 47 // besides Window that is operable in a RemoteFrame. Location needs to be
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 String origin() const; 111 String origin() const;
111 112
112 DOMStringList* ancestorOrigins() const; 113 DOMStringList* ancestorOrigins() const;
113 114
114 // Just return the |this| object the way the normal valueOf function on the 115 // Just return the |this| object the way the normal valueOf function on the
115 // Object prototype would. The valueOf function is only added to make sure 116 // Object prototype would. The valueOf function is only added to make sure
116 // that it cannot be overwritten on location objects, since that would provide 117 // that it cannot be overwritten on location objects, since that would provide
117 // a hook to change the string conversion behavior of location objects. 118 // a hook to change the string conversion behavior of location objects.
118 ScriptValue valueOf(const ScriptValue& thisObject) { return thisObject; } 119 ScriptValue valueOf(const ScriptValue& thisObject) { return thisObject; }
119 120
121 // v8 wrapper used only for cross-origin accesses.
122 v8::Local<v8::Object> crossOriginWrapper(v8::Isolate*);
123
120 DECLARE_VIRTUAL_TRACE(); 124 DECLARE_VIRTUAL_TRACE();
121 125
122 private: 126 private:
123 explicit Location(Frame*); 127 explicit Location(Frame*);
124 128
125 enum class SetLocationPolicy { Normal, ReplaceThisFrame }; 129 enum class SetLocationPolicy { Normal, ReplaceThisFrame };
126 void setLocation(const String&, 130 void setLocation(const String&,
127 LocalDOMWindow* currentWindow, 131 LocalDOMWindow* currentWindow,
128 LocalDOMWindow* enteredWindow, 132 LocalDOMWindow* enteredWindow,
129 ExceptionState* = nullptr, 133 ExceptionState* = nullptr,
130 SetLocationPolicy = SetLocationPolicy::Normal); 134 SetLocationPolicy = SetLocationPolicy::Normal);
131 135
132 const KURL& url() const; 136 const KURL& url() const;
133 137
134 Member<Frame> m_frame; 138 Member<Frame> m_frame;
139 v8::Persistent<v8::Object> m_crossOriginWrapper;
135 }; 140 };
136 141
137 } // namespace blink 142 } // namespace blink
138 143
139 #endif // Location_h 144 #endif // Location_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698