summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8/v8_proxy.h
diff options
context:
space:
mode:
authorfqian@google.com <fqian@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-22 23:07:54 +0000
committerfqian@google.com <fqian@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-22 23:07:54 +0000
commit7747859358a1a201fc8d8e65664435b979f99c37 (patch)
tree5f25b6ca30524c16a7e399966b4d839c88fc70f7 /webkit/port/bindings/v8/v8_proxy.h
parent9bd6f38ddfe66712e8e04de142ae64fa70ea5ada (diff)
downloadchromium_src-7747859358a1a201fc8d8e65664435b979f99c37.zip
chromium_src-7747859358a1a201fc8d8e65664435b979f99c37.tar.gz
chromium_src-7747859358a1a201fc8d8e65664435b979f99c37.tar.bz2
Second part of split window support in the binding part.
The major change is that when a frame is loading a new page, the frame loader calls V8Proxy::clearWindowShell when it receives the first piece of data. At that point, the global object is detached from its current context. FrameLoader continues on preparing new environment, including creating new DOMWindow and security origin for the frame. When new DOMWindow is ready, the frame loader calls ScriptController::notifyNewDOMWindowReady(), which uses the existing global object to initialize the new context for the frame. Between detaching global from old context and creating new context using global, there should no JavaScript executed. The implication is that if the new page does not use JavaScript, its JS context is still created. But the overhead should be very small because V8 is warmed up already. Review URL: http://codereview.chromium.org/7838 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/bindings/v8/v8_proxy.h')
-rw-r--r--webkit/port/bindings/v8/v8_proxy.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h
index 0923570..f1b558f 100644
--- a/webkit/port/bindings/v8/v8_proxy.h
+++ b/webkit/port/bindings/v8/v8_proxy.h
@@ -11,6 +11,7 @@
#include "v8_utility.h"
#include "Node.h"
#include "NodeFilter.h"
+#include "SecurityOrigin.h" // for WebCore::SecurityOrigin
#include "PlatformString.h" // for WebCore::String
#include <wtf/HashMap.h> // for HashMap
#include <wtf/PassRefPtr.h> // so generated bindings don't have to
@@ -157,18 +158,20 @@ class V8Proxy {
~V8Proxy();
- // Clear security token by setting the security token
- // for the context to the global object.
- void ClearSecurityToken();
+ Frame* frame() { return m_frame; }
+
+ // Clear page-specific data, but keep the global object identify.
+ void clearForNavigation();
- // Clear page-specific data, exception keep the global object identify.
- void clear();
+ // Clear data before closing the frame.
+ void clearForClose();
+
+ // Notify that a new DOMWindow object is ready.
+ void domWindowReady();
// Destroy the global object.
void DestroyGlobal();
- Frame* frame() { return m_frame; }
-
// TODO(mpcomplete): Need comment. User Gesture related.
bool inlineCode() const { return m_inlineCode; }
void setInlineCode(bool value) { m_inlineCode = value; }
@@ -262,21 +265,13 @@ class V8Proxy {
// is disabled and it returns true.
static bool HandleOutOfMemory();
- // Generate the security token for a context.
- static v8::Handle<v8::Value> GenerateSecurityToken(
- v8::Local<v8::Context> context);
-
- // Check if the active execution context is from the same origin
- // as the target frame.
- static bool IsFromSameOrigin(Frame* target, bool report_error);
+ // Check if the active execution context can access the target frame.
+ static bool CanAccessFrame(Frame* target, bool report_error);
// Check if it is safe to access the given node from the
// current security context.
static bool CheckNodeSecurity(Node* node);
- // Return true if the current security context can access the target frame.
- static bool CanAccess(Frame* target);
-
static v8::Handle<v8::Value> CheckNewLegal(const v8::Arguments& args);
// Create a V8 wrapper for a C pointer
@@ -421,6 +416,8 @@ class V8Proxy {
void initContextIfNeeded();
void DisconnectEventListeners();
+ static bool CanAccessPrivate(DOMWindow* target);
+
// Check whether a V8 value is a DOM Event wrapper
static bool IsDOMEventWrapper(v8::Handle<v8::Value> obj);