| Index: sky/engine/bindings-dart/core/dart/DartIsolateDestructionObserver.cpp
|
| diff --git a/sky/engine/platform/PlatformThreadData.cpp b/sky/engine/bindings-dart/core/dart/DartIsolateDestructionObserver.cpp
|
| similarity index 69%
|
| copy from sky/engine/platform/PlatformThreadData.cpp
|
| copy to sky/engine/bindings-dart/core/dart/DartIsolateDestructionObserver.cpp
|
| index 4c73f145892fd21c0664afcde1afd09f65ee25f0..8f8833b52bd0f8da6dc4d8269667a13db4f91335 100644
|
| --- a/sky/engine/platform/PlatformThreadData.cpp
|
| +++ b/sky/engine/bindings-dart/core/dart/DartIsolateDestructionObserver.cpp
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + * Copyright (C) 2006-2012 Google Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -28,36 +28,32 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#include "sky/engine/config.h"
|
| -#include "sky/engine/platform/PlatformThreadData.h"
|
| +#include "config.h"
|
| +#include "bindings/core/dart/DartIsolateDestructionObserver.h"
|
|
|
| -#include "sky/engine/platform/ThreadTimers.h"
|
| -#include "sky/engine/wtf/PassOwnPtr.h"
|
| -#include "sky/engine/wtf/ThreadSpecific.h"
|
| +#include "bindings/core/dart/DartDOMData.h"
|
| +#include "bindings/core/dart/DartUtilities.h"
|
|
|
| namespace blink {
|
|
|
| -static ThreadSpecific<PlatformThreadData>* s_data;
|
| -
|
| -PlatformThreadData::PlatformThreadData()
|
| - : m_threadTimers(adoptPtr(new ThreadTimers))
|
| +DartIsolateDestructionObserver::DartIsolateDestructionObserver()
|
| {
|
| + m_isolate = Dart_CurrentIsolate();
|
| + DartDOMData::current()->isolateDestructionObservers()->add(this);
|
| }
|
|
|
| -PlatformThreadData::~PlatformThreadData()
|
| +DartIsolateDestructionObserver::~DartIsolateDestructionObserver()
|
| {
|
| -}
|
| + if (!m_isolate)
|
| + return;
|
|
|
| -void PlatformThreadData::destroy()
|
| -{
|
| - m_threadTimers.clear();
|
| + DartIsolateScope scope(m_isolate);
|
| + DartDOMData::current()->isolateDestructionObservers()->remove(this);
|
| }
|
|
|
| -PlatformThreadData& PlatformThreadData::current()
|
| +void DartIsolateDestructionObserver::isolateDestroyed()
|
| {
|
| - if (!s_data)
|
| - s_data = new ThreadSpecific<PlatformThreadData>;
|
| - return **s_data;
|
| + m_isolate = 0;
|
| }
|
|
|
| -} // namespace blink
|
| +}
|
|
|