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

Unified Diff: fxjs/cfxjse_isolatetracker.cpp

Issue 2136213002: Rename fxjse/ to fxjs/ update files to match class names. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add todo Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fxjs/cfxjse_isolatetracker.h ('k') | fxjs/cfxjse_runtimedata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/cfxjse_isolatetracker.cpp
diff --git a/fxjs/cfxjse_isolatetracker.cpp b/fxjs/cfxjse_isolatetracker.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9594df310915db8bcf19bb818a21ae0fc94e9e14
--- /dev/null
+++ b/fxjs/cfxjse_isolatetracker.cpp
@@ -0,0 +1,35 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fxjs/cfxjse_isolatetracker.h"
+
+#include <algorithm>
+
+CFXJSE_IsolateTracker::CFXJSE_IsolateTracker() {}
+
+CFXJSE_IsolateTracker::~CFXJSE_IsolateTracker() {}
+
+void CFXJSE_IsolateTracker::Append(v8::Isolate* pIsolate) {
+ m_OwnedIsolates.push_back(pIsolate);
+}
+
+void CFXJSE_IsolateTracker::Remove(
+ v8::Isolate* pIsolate,
+ CFXJSE_IsolateTracker::DisposeCallback lpfnDisposeCallback) {
+ auto it = std::find(m_OwnedIsolates.begin(), m_OwnedIsolates.end(), pIsolate);
+ bool bFound = it != m_OwnedIsolates.end();
+ if (bFound)
+ m_OwnedIsolates.erase(it);
+ lpfnDisposeCallback(pIsolate, bFound);
+}
+
+void CFXJSE_IsolateTracker::RemoveAll(
+ CFXJSE_IsolateTracker::DisposeCallback lpfnDisposeCallback) {
+ for (v8::Isolate* pIsolate : m_OwnedIsolates)
+ lpfnDisposeCallback(pIsolate, true);
+
+ m_OwnedIsolates.clear();
+}
« no previous file with comments | « fxjs/cfxjse_isolatetracker.h ('k') | fxjs/cfxjse_runtimedata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698