OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "fxjse/include/fxjs_perisolatedata.h" |
| 8 |
| 9 static unsigned int g_embedderDataSlot = 1u; |
| 10 |
| 11 // static |
| 12 void FXJS_PerIsolateData::SetEmbedderDataSlot(unsigned int slot) { |
| 13 g_embedderDataSlot = slot; |
| 14 } |
| 15 |
| 16 // static |
| 17 unsigned int FXJS_PerIsolateData::EmbedderDataSlot() { |
| 18 return g_embedderDataSlot; |
| 19 } |
| 20 |
| 21 // static |
| 22 void FXJS_PerIsolateData::SetUp(v8::Isolate* pIsolate) { |
| 23 if (!pIsolate->GetData(g_embedderDataSlot)) |
| 24 pIsolate->SetData(g_embedderDataSlot, new FXJS_PerIsolateData()); |
| 25 } |
| 26 |
| 27 // static |
| 28 FXJS_PerIsolateData* FXJS_PerIsolateData::Get(v8::Isolate* pIsolate) { |
| 29 return static_cast<FXJS_PerIsolateData*>( |
| 30 pIsolate->GetData(g_embedderDataSlot)); |
| 31 } |
OLD | NEW |