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

Unified Diff: sky/engine/bindings-dart/core/dart/DartIsolateDestructionObserver.cpp

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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
+}

Powered by Google App Engine
This is Rietveld 408576698