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

Side by Side Diff: Source/bindings/core/dart/DartDOMWrapper.h

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, Google Inc.
2 // All rights reserved. 2 // 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 template <class BindingsClass> 315 template <class BindingsClass>
316 static void associateWrapper( 316 static void associateWrapper(
317 DartDOMData* domData, typename BindingsClass::NativeType* domObject, Dar t_Handle newInstance) 317 DartDOMData* domData, typename BindingsClass::NativeType* domObject, Dar t_Handle newInstance)
318 { 318 {
319 typedef DartDOMWrapperTraits<BindingsClass> Traits; 319 typedef DartDOMWrapperTraits<BindingsClass> Traits;
320 void* blinkHandle = Traits::GCTraits::ref(domObject); 320 void* blinkHandle = Traits::GCTraits::ref(domObject);
321 // This is only used to inform the Dart garbage collector on how much ex ternal memory 321 // This is only used to inform the Dart garbage collector on how much ex ternal memory
322 // is kept alive. 322 // is kept alive.
323 intptr_t externalAllocationSize = sizeof(*domObject); 323 intptr_t externalAllocationSize = sizeof(*domObject);
324 324
325 Dart_WeakPersistentHandle wrapper = Dart_NewPrologueWeakPersistentHandle ( 325 Dart_WeakPersistentHandle wrapper = Dart_NewWeakPersistentHandle(
326 newInstance, blinkHandle, externalAllocationSize, &wrapperWeakCallba ck<BindingsClass>); 326 newInstance, blinkHandle, externalAllocationSize, &wrapperWeakCallba ck<BindingsClass>);
327 Traits::MapTraits::domMap(domData)->set(domObject, wrapper); 327 Traits::MapTraits::domMap(domData)->set(domObject, wrapper);
328 } 328 }
329 329
330 template <class BindingsClass> 330 template <class BindingsClass>
331 static void disassociateWrapper( 331 static void disassociateWrapper(
332 DartDOMData* domData, typename BindingsClass::NativeType* domObject, Dar t_Handle oldInstance) 332 DartDOMData* domData, typename BindingsClass::NativeType* domObject, Dar t_Handle oldInstance)
333 { 333 {
334 typedef DartDOMWrapperTraits<BindingsClass> Traits; 334 typedef DartDOMWrapperTraits<BindingsClass> Traits;
335 335
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 struct MessagePortMapTraits { 405 struct MessagePortMapTraits {
406 static DartMessagePortMap* domMap(DartDOMData* domData) { return domData ->messagePortMap(); } 406 static DartMessagePortMap* domMap(DartDOMData* domData) { return domData ->messagePortMap(); }
407 }; 407 };
408 typedef MessagePortMapTraits MapTraits; 408 typedef MessagePortMapTraits MapTraits;
409 typedef DartDOMWrapperGarbageCollectedTraits<DartMessagePort, false> GCTrait s; 409 typedef DartDOMWrapperGarbageCollectedTraits<DartMessagePort, false> GCTrait s;
410 }; 410 };
411 411
412 } 412 }
413 413
414 #endif // DartDOMWrapper_h 414 #endif // DartDOMWrapper_h
OLDNEW
« no previous file with comments | « Source/bindings/core/dart/DartDOMData.cpp ('k') | Source/bindings/core/dart/DartEventListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698