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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Update document object of the frame. | 55 // Update document object of the frame. |
56 void updateDocument(); | 56 void updateDocument(); |
57 | 57 |
58 void namedItemAdded(HTMLDocument*, const AtomicString&); | 58 void namedItemAdded(HTMLDocument*, const AtomicString&); |
59 void namedItemRemoved(HTMLDocument*, const AtomicString&); | 59 void namedItemRemoved(HTMLDocument*, const AtomicString&); |
60 | 60 |
61 // Update the security origin of a document | 61 // Update the security origin of a document |
62 // (e.g., after setting docoument.domain). | 62 // (e.g., after setting docoument.domain). |
63 void updateSecurityOrigin(SecurityOrigin*); | 63 void updateSecurityOrigin(SecurityOrigin*); |
64 | 64 |
| 65 ScriptState* getScriptState() const { return m_scriptState.get(); } |
| 66 v8::Local<v8::Context> contextIfInitialized() const { |
| 67 return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); |
| 68 } |
| 69 |
65 private: | 70 private: |
66 LocalWindowProxy(v8::Isolate*, LocalFrame&, RefPtr<DOMWrapperWorld>); | 71 LocalWindowProxy(v8::Isolate*, LocalFrame&, RefPtr<DOMWrapperWorld>); |
67 | 72 |
68 void initialize() override; | 73 void initialize() override; |
69 void disposeContext(GlobalDetachmentBehavior) override; | 74 void disposeContext(GlobalDetachmentBehavior) override; |
70 | 75 |
71 // Creates a new v8::Context with the window wrapper object as the global | 76 // Creates a new v8::Context with the window wrapper object as the global |
72 // object (aka the inner global). Note that the window wrapper and its | 77 // object (aka the inner global). Note that the window wrapper and its |
73 // prototype chain do not get fully initialized yet, e.g. the window | 78 // prototype chain do not get fully initialized yet, e.g. the window |
74 // wrapper is not yet associated with the native DOMWindow object. | 79 // wrapper is not yet associated with the native DOMWindow object. |
75 void createContext(); | 80 void createContext(); |
76 | 81 |
| 82 // Associates the window wrapper and its prototype chain with the native |
| 83 // DOMWindow object. Also does some more Window-specific initialization. |
| 84 void setupWindowPrototypeChain(); |
| 85 |
77 void setSecurityToken(SecurityOrigin*); | 86 void setSecurityToken(SecurityOrigin*); |
78 | 87 |
79 // The JavaScript wrapper for the document object is cached on the global | 88 // The JavaScript wrapper for the document object is cached on the global |
80 // object for fast access. UpdateDocumentProperty sets the wrapper | 89 // object for fast access. UpdateDocumentProperty sets the wrapper |
81 // for the current document on the global object. | 90 // for the current document on the global object. |
82 void updateDocumentProperty(); | 91 void updateDocumentProperty(); |
83 | 92 |
84 // Updates Activity Logger for the current context. | 93 // Updates Activity Logger for the current context. |
85 void updateActivityLogger(); | 94 void updateActivityLogger(); |
86 | 95 |
87 LocalFrame* frame() const { return toLocalFrame(WindowProxy::frame()); } | 96 LocalFrame* frame() const { return toLocalFrame(WindowProxy::frame()); } |
| 97 |
| 98 RefPtr<ScriptState> m_scriptState; |
88 }; | 99 }; |
89 | 100 |
90 } // namespace blink | 101 } // namespace blink |
91 | 102 |
92 #endif // LocalWindowProxy_h | 103 #endif // LocalWindowProxy_h |
OLD | NEW |