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

Side by Side Diff: trunk/Source/bindings/v8/V8WindowShell.h

Issue 218813002: Revert 170357 "Revert of Make DOMWrapperWorld::current() return ..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 class DOMWindow; 49 class DOMWindow;
50 class LocalFrame; 50 class LocalFrame;
51 class HTMLDocument; 51 class HTMLDocument;
52 class SecurityOrigin; 52 class SecurityOrigin;
53 53
54 // V8WindowShell represents all the per-global object state for a LocalFrame tha t 54 // V8WindowShell represents all the per-global object state for a LocalFrame tha t
55 // persist between navigations. 55 // persist between navigations.
56 class V8WindowShell { 56 class V8WindowShell {
57 public: 57 public:
58 static PassOwnPtr<V8WindowShell> create(LocalFrame*, PassRefPtr<DOMWrapperWo rld>, v8::Isolate*); 58 static PassOwnPtr<V8WindowShell> create(LocalFrame*, DOMWrapperWorld&, v8::I solate*);
59 59
60 v8::Local<v8::Context> context() const { return m_perContextData ? m_perCont extData->context() : v8::Local<v8::Context>(); } 60 v8::Local<v8::Context> context() const { return m_perContextData ? m_perCont extData->context() : v8::Local<v8::Context>(); }
61 61
62 // Update document object of the frame. 62 // Update document object of the frame.
63 void updateDocument(); 63 void updateDocument();
64 64
65 void namedItemAdded(HTMLDocument*, const AtomicString&); 65 void namedItemAdded(HTMLDocument*, const AtomicString&);
66 void namedItemRemoved(HTMLDocument*, const AtomicString&); 66 void namedItemRemoved(HTMLDocument*, const AtomicString&);
67 67
68 // Update the security origin of a document 68 // Update the security origin of a document
69 // (e.g., after setting docoument.domain). 69 // (e.g., after setting docoument.domain).
70 void updateSecurityOrigin(SecurityOrigin*); 70 void updateSecurityOrigin(SecurityOrigin*);
71 71
72 bool isContextInitialized() { return m_perContextData; } 72 bool isContextInitialized() { return m_perContextData; }
73 bool isGlobalInitialized() { return !m_global.isEmpty(); } 73 bool isGlobalInitialized() { return !m_global.isEmpty(); }
74 74
75 bool initializeIfNeeded(); 75 bool initializeIfNeeded();
76 void updateDocumentWrapper(v8::Handle<v8::Object> wrapper); 76 void updateDocumentWrapper(v8::Handle<v8::Object> wrapper);
77 77
78 void clearForNavigation(); 78 void clearForNavigation();
79 void clearForClose(); 79 void clearForClose();
80 80
81 DOMWrapperWorld* world() { return m_world.get(); } 81 DOMWrapperWorld& world() { return *m_world; }
82 82
83 private: 83 private:
84 V8WindowShell(LocalFrame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*); 84 V8WindowShell(LocalFrame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*);
85 bool initialize(); 85 bool initialize();
86 86
87 enum GlobalDetachmentBehavior { 87 enum GlobalDetachmentBehavior {
88 DoNotDetachGlobal, 88 DoNotDetachGlobal,
89 DetachGlobal 89 DetachGlobal
90 }; 90 };
91 void disposeContext(GlobalDetachmentBehavior); 91 void disposeContext(GlobalDetachmentBehavior);
(...skipping 16 matching lines...) Expand all
108 RefPtr<DOMWrapperWorld> m_world; 108 RefPtr<DOMWrapperWorld> m_world;
109 v8::Isolate* m_isolate; 109 v8::Isolate* m_isolate;
110 OwnPtr<V8PerContextData> m_perContextData; 110 OwnPtr<V8PerContextData> m_perContextData;
111 ScopedPersistent<v8::Object> m_global; 111 ScopedPersistent<v8::Object> m_global;
112 ScopedPersistent<v8::Object> m_document; 112 ScopedPersistent<v8::Object> m_document;
113 }; 113 };
114 114
115 } // namespace WebCore 115 } // namespace WebCore
116 116
117 #endif // V8WindowShell_h 117 #endif // V8WindowShell_h
OLDNEW
« no previous file with comments | « trunk/Source/bindings/v8/V8PerIsolateData.cpp ('k') | trunk/Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698