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

Side by Side Diff: Source/bindings/v8/ScriptWrappable.h

Issue 19457002: Make 'any'-typed attributes of events available in isolated worlds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 5 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) 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 m_wrapperOrTypeInfo = 0; 69 m_wrapperOrTypeInfo = 0;
70 return; 70 return;
71 } 71 }
72 v8::Persistent<v8::Object> persistent(isolate, wrapper); 72 v8::Persistent<v8::Object> persistent(isolate, wrapper);
73 configuration.configureWrapper(&persistent, isolate); 73 configuration.configureWrapper(&persistent, isolate);
74 persistent.MakeWeak(this, &makeWeakCallback); 74 persistent.MakeWeak(this, &makeWeakCallback);
75 m_wrapperOrTypeInfo = reinterpret_cast<uintptr_t>(persistent.ClearAndLea k()) | 1; 75 m_wrapperOrTypeInfo = reinterpret_cast<uintptr_t>(persistent.ClearAndLea k()) | 1;
76 ASSERT(containsWrapper()); 76 ASSERT(containsWrapper());
77 } 77 }
78 78
79 v8::Local<v8::Object> newLocalWrapper(v8::Isolate* isolate) const
80 {
81 return unsafePersistent().newLocal(isolate);
82 }
83
79 const WrapperTypeInfo* typeInfo() 84 const WrapperTypeInfo* typeInfo()
80 { 85 {
81 if (containsTypeInfo()) 86 if (containsTypeInfo())
82 return reinterpret_cast<const WrapperTypeInfo*>(m_wrapperOrTypeInfo) ; 87 return reinterpret_cast<const WrapperTypeInfo*>(m_wrapperOrTypeInfo) ;
83 88
84 if (containsWrapper()) { 89 if (containsWrapper()) {
85 return toWrapperTypeInfo(unsafePersistent().handle()); 90 return toWrapperTypeInfo(unsafePersistent().handle());
86 } 91 }
87 92
88 return 0; 93 return 0;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed 197 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed
193 // inside key->deref(), which causes Node destructions. We should 198 // inside key->deref(), which causes Node destructions. We should
194 // make Node destructions incremental. 199 // make Node destructions incremental.
195 info->derefObject(object); 200 info->derefObject(object);
196 } 201 }
197 }; 202 };
198 203
199 } // namespace WebCore 204 } // namespace WebCore
200 205
201 #endif // ScriptWrappable_h 206 #endif // ScriptWrappable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698