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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.h

Issue 2721693002: Revert of Switch RemoteWindowProxy to use v8::Context::NewRemoteContext. (Closed)
Patch Set: Created 3 years, 9 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) 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
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
70 private: 65 private:
71 LocalWindowProxy(v8::Isolate*, LocalFrame&, RefPtr<DOMWrapperWorld>); 66 LocalWindowProxy(v8::Isolate*, LocalFrame&, RefPtr<DOMWrapperWorld>);
72 67
73 void initialize() override; 68 void initialize() override;
74 void disposeContext(GlobalDetachmentBehavior) override; 69 void disposeContext(GlobalDetachmentBehavior) override;
75 70
76 // Creates a new v8::Context with the window wrapper object as the global 71 // Creates a new v8::Context with the window wrapper object as the global
77 // object (aka the inner global). Note that the window wrapper and its 72 // object (aka the inner global). Note that the window wrapper and its
78 // prototype chain do not get fully initialized yet, e.g. the window 73 // prototype chain do not get fully initialized yet, e.g. the window
79 // wrapper is not yet associated with the native DOMWindow object. 74 // wrapper is not yet associated with the native DOMWindow object.
80 void createContext(); 75 void createContext();
81 76
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
86 void setSecurityToken(SecurityOrigin*); 77 void setSecurityToken(SecurityOrigin*);
87 78
88 // The JavaScript wrapper for the document object is cached on the global 79 // The JavaScript wrapper for the document object is cached on the global
89 // object for fast access. UpdateDocumentProperty sets the wrapper 80 // object for fast access. UpdateDocumentProperty sets the wrapper
90 // for the current document on the global object. 81 // for the current document on the global object.
91 void updateDocumentProperty(); 82 void updateDocumentProperty();
92 83
93 // Updates Activity Logger for the current context. 84 // Updates Activity Logger for the current context.
94 void updateActivityLogger(); 85 void updateActivityLogger();
95 86
96 LocalFrame* frame() const { return toLocalFrame(WindowProxy::frame()); } 87 LocalFrame* frame() const { return toLocalFrame(WindowProxy::frame()); }
97
98 RefPtr<ScriptState> m_scriptState;
99 }; 88 };
100 89
101 } // namespace blink 90 } // namespace blink
102 91
103 #endif // LocalWindowProxy_h 92 #endif // LocalWindowProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698