summaryrefslogtreecommitdiff
path: root/xfa/fxjse/context.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-09 11:49:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-09 11:49:22 -0700
commit3cace320e07bb954710c50fc7634ca3a8f3eda38 (patch)
tree83f38f491e9cdc1f9bda3935f3f845528434864a /xfa/fxjse/context.cpp
parent2f5582f46dce2abfe9d75ea5f885a2ce0a4c10d2 (diff)
downloadpdfium-3cace320e07bb954710c50fc7634ca3a8f3eda38.tar.xz
Change CFXJSE_Context::GetGlobalObject to return
This Cl changes CFXJSE_Context::GetGlobalObject to return a std::unique_ptr<CFXJSE_Value> instead of accepting a CFXJSE_Value out parameter. All usages created the CFXJSE_Value with the same runtime as the caller. Review-Url: https://codereview.chromium.org/2056733003
Diffstat (limited to 'xfa/fxjse/context.cpp')
-rw-r--r--xfa/fxjse/context.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/xfa/fxjse/context.cpp b/xfa/fxjse/context.cpp
index 8eacc77a74..e5d5f994d5 100644
--- a/xfa/fxjse/context.cpp
+++ b/xfa/fxjse/context.cpp
@@ -157,13 +157,16 @@ CFXJSE_Context::CFXJSE_Context(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
CFXJSE_Context::~CFXJSE_Context() {}
-void CFXJSE_Context::GetGlobalObject(CFXJSE_Value* pValue) {
- ASSERT(pValue);
+std::unique_ptr<CFXJSE_Value> CFXJSE_Context::GetGlobalObject() {
+ std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate));
+
CFXJSE_ScopeUtil_IsolateHandleContext scope(this);
v8::Local<v8::Context> hContext =
v8::Local<v8::Context>::New(m_pIsolate, m_hContext);
v8::Local<v8::Object> hGlobalObject = hContext->Global();
pValue->ForceSetValue(hGlobalObject);
+
+ return pValue;
}
void CFXJSE_Context::EnableCompatibleMode() {