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

Unified Diff: fxjse/fxjs_perisolatedata.cpp

Issue 2053043002: Untangle bad depdenency from fxjse/ to fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@move_fxjse
Patch Set: Created 4 years, 6 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 | « fxjse/DEPS ('k') | fxjse/include/fxjs_perisolatedata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjse/fxjs_perisolatedata.cpp
diff --git a/fxjse/fxjs_perisolatedata.cpp b/fxjse/fxjs_perisolatedata.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1a2f96b363571e18b0f748cb3c9c645ad36fe475
--- /dev/null
+++ b/fxjse/fxjs_perisolatedata.cpp
@@ -0,0 +1,31 @@
+// 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 "fxjse/include/fxjs_perisolatedata.h"
+
+static unsigned int g_embedderDataSlot = 1u;
+
+// static
+void FXJS_PerIsolateData::SetEmbedderDataSlot(unsigned int slot) {
+ g_embedderDataSlot = slot;
+}
+
+// static
+unsigned int FXJS_PerIsolateData::EmbedderDataSlot() {
+ return g_embedderDataSlot;
+}
+
+// static
+void FXJS_PerIsolateData::SetUp(v8::Isolate* pIsolate) {
+ if (!pIsolate->GetData(g_embedderDataSlot))
+ pIsolate->SetData(g_embedderDataSlot, new FXJS_PerIsolateData());
+}
+
+// static
+FXJS_PerIsolateData* FXJS_PerIsolateData::Get(v8::Isolate* pIsolate) {
+ return static_cast<FXJS_PerIsolateData*>(
+ pIsolate->GetData(g_embedderDataSlot));
+}
« no previous file with comments | « fxjse/DEPS ('k') | fxjse/include/fxjs_perisolatedata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698