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

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

Issue 2690943002: Revert of binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 wrapper = mainWorldWrapper(isolate); 121 wrapper = mainWorldWrapper(isolate);
122 return false; 122 return false;
123 } 123 }
124 m_mainWorldWrapper.Reset(isolate, wrapper); 124 m_mainWorldWrapper.Reset(isolate, wrapper);
125 wrapperTypeInfo->configureWrapper(&m_mainWorldWrapper); 125 wrapperTypeInfo->configureWrapper(&m_mainWorldWrapper);
126 m_mainWorldWrapper.SetWeak(); 126 m_mainWorldWrapper.SetWeak();
127 ASSERT(containsWrapper()); 127 ASSERT(containsWrapper());
128 return true; 128 return true;
129 } 129 }
130 130
131 // Dissociates the wrapper, if any, from this instance.
132 void unsetWrapperIfAny() {
133 if (containsWrapper()) {
134 m_mainWorldWrapper.Reset();
135 WrapperTypeInfo::wrapperDestroyed();
136 }
137 }
138
139 bool isEqualTo(const v8::Local<v8::Object>& other) const { 131 bool isEqualTo(const v8::Local<v8::Object>& other) const {
140 return m_mainWorldWrapper == other; 132 return m_mainWorldWrapper == other;
141 } 133 }
142 134
143 // Provides a way to convert Node* to ScriptWrappable* without including 135 // Provides a way to convert Node* to ScriptWrappable* without including
144 // "core/dom/Node.h". 136 // "core/dom/Node.h".
145 // 137 //
146 // Example: 138 // Example:
147 // void foo(const void*) { ... } // [1] 139 // void foo(const void*) { ... } // [1]
148 // void foo(ScriptWrappable*) { ... } // [2] 140 // void foo(ScriptWrappable*) { ... } // [2]
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 #define DECLARE_WRAPPERTYPEINFO() \ 211 #define DECLARE_WRAPPERTYPEINFO() \
220 public: \ 212 public: \
221 const WrapperTypeInfo* wrapperTypeInfo() const override; \ 213 const WrapperTypeInfo* wrapperTypeInfo() const override; \
222 \ 214 \
223 private: \ 215 private: \
224 typedef void end_of_define_wrappertypeinfo_not_reached_t 216 typedef void end_of_define_wrappertypeinfo_not_reached_t
225 217
226 } // namespace blink 218 } // namespace blink
227 219
228 #endif // ScriptWrappable_h 220 #endif // ScriptWrappable_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/ToV8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698