diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-02 17:24:58 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-02 17:24:58 +0000 |
commit | 9cbd2dd8ff0812aae57a99d6a7dc285cc8b9e262 (patch) | |
tree | 1154231be2ecfddc3635f6e0e3f837e0dd70376d /fxjs | |
parent | 48b47f48ae6c5e3206bc306f2215a82273d5a313 (diff) | |
download | pdfium-9cbd2dd8ff0812aae57a99d6a7dc285cc8b9e262.tar.xz |
Make global object function names clearer.
Also tidy some sub-expressions.
Change-Id: Ieabd5f6cea60e8ec03c8ce5ebe372fc80b05a7bb
Reviewed-on: https://pdfium-review.googlesource.com/25150
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r-- | fxjs/cfxjse_engine.cpp | 8 | ||||
-rw-r--r-- | fxjs/cjs_runtime.cpp | 8 | ||||
-rw-r--r-- | fxjs/cjs_runtime.h | 8 | ||||
-rw-r--r-- | fxjs/cjs_runtimestub.cpp | 6 | ||||
-rw-r--r-- | fxjs/ijs_runtime.h | 8 |
5 files changed, 20 insertions, 18 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp index 198e1d5fa8..84981666df 100644 --- a/fxjs/cfxjse_engine.cpp +++ b/fxjs/cfxjse_engine.cpp @@ -202,8 +202,8 @@ void CFXJSE_Engine::GlobalPropertySetter(CFXJSE_Value* pObject, if (!pNotify) return; - pNotify->GetDocEnvironment()->SetGlobalProperty(pNotify->GetHDOC(), - szPropName, pValue); + pNotify->GetDocEnvironment()->SetPropertyInNonXFAGlobalObject( + pNotify->GetHDOC(), szPropName, pValue); } void CFXJSE_Engine::GlobalPropertyGetter(CFXJSE_Value* pObject, @@ -259,8 +259,8 @@ void CFXJSE_Engine::GlobalPropertyGetter(CFXJSE_Value* pObject, if (!pNotify) return; - pNotify->GetDocEnvironment()->GetGlobalProperty(pNotify->GetHDOC(), - szPropName, pValue); + pNotify->GetDocEnvironment()->GetPropertyFromNonXFAGlobalObject( + pNotify->GetHDOC(), szPropName, pValue); } int32_t CFXJSE_Engine::GlobalPropTypeGetter(CFXJSE_Value* pOriginalValue, diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp index bffd77cba7..4031304b83 100644 --- a/fxjs/cjs_runtime.cpp +++ b/fxjs/cjs_runtime.cpp @@ -231,8 +231,8 @@ WideString ChangeObjName(const WideString& str) { return sRet; } -bool CJS_Runtime::GetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) { +bool CJS_Runtime::GetValueByNameFromGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) { v8::Isolate::Scope isolate_scope(GetIsolate()); v8::HandleScope handle_scope(GetIsolate()); v8::Local<v8::Context> context = NewLocalContext(); @@ -248,8 +248,8 @@ bool CJS_Runtime::GetValueByName(const ByteStringView& utf8Name, return true; } -bool CJS_Runtime::SetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) { +bool CJS_Runtime::SetValueByNameInGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) { if (utf8Name.IsEmpty() || !pValue) return false; diff --git a/fxjs/cjs_runtime.h b/fxjs/cjs_runtime.h index 5d55b9a492..9d0d47fa81 100644 --- a/fxjs/cjs_runtime.h +++ b/fxjs/cjs_runtime.h @@ -53,10 +53,10 @@ class CJS_Runtime : public IJS_Runtime, v8::Local<v8::Value> MaybeCoerceToNumber(v8::Local<v8::Value> value); #ifdef PDF_ENABLE_XFA - bool GetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) override; - bool SetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) override; + bool GetValueByNameFromGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) override; + bool SetValueByNameInGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) override; #endif // PDF_ENABLE_XFA private: diff --git a/fxjs/cjs_runtimestub.cpp b/fxjs/cjs_runtimestub.cpp index 964b0ff9d6..105bb6f114 100644 --- a/fxjs/cjs_runtimestub.cpp +++ b/fxjs/cjs_runtimestub.cpp @@ -30,11 +30,13 @@ class CJS_RuntimeStub final : public IJS_Runtime { } #ifdef PDF_ENABLE_XFA - bool GetValueByName(const ByteStringView&, CFXJSE_Value*) override { + bool GetValueByNameFromGlobalObject(const ByteStringView&, + CFXJSE_Value*) override { return false; } - bool SetValueByName(const ByteStringView&, CFXJSE_Value*) override { + bool SetValueByNameInGlobalObject(const ByteStringView&, + CFXJSE_Value*) override { return false; } #endif // PDF_ENABLE_XFA diff --git a/fxjs/ijs_runtime.h b/fxjs/ijs_runtime.h index 9fe5d2fed8..b97c65ef90 100644 --- a/fxjs/ijs_runtime.h +++ b/fxjs/ijs_runtime.h @@ -34,10 +34,10 @@ class IJS_Runtime { virtual int ExecuteScript(const WideString& script, WideString* info) = 0; #ifdef PDF_ENABLE_XFA - virtual bool GetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) = 0; - virtual bool SetValueByName(const ByteStringView& utf8Name, - CFXJSE_Value* pValue) = 0; + virtual bool GetValueByNameFromGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) = 0; + virtual bool SetValueByNameInGlobalObject(const ByteStringView& utf8Name, + CFXJSE_Value* pValue) = 0; #endif // PDF_ENABLE_XFA protected: |