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

Side by Side Diff: fpdfsdk/src/javascript/JS_Object.cpp

Issue 1413733004: Remove FXJS_GetRuntime (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Also remove CreationContext Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/global.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "JS_Object.h" 7 #include "JS_Object.h"
8 8
9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. 9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
10 #include "../../include/javascript/IJavaScript.h" 10 #include "../../include/javascript/IJavaScript.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 FXJS_FreePrivate(data.GetInternalField(0)); 54 FXJS_FreePrivate(data.GetInternalField(0));
55 } 55 }
56 56
57 void DisposeObject(const v8::WeakCallbackInfo<CJS_Object>& data) { 57 void DisposeObject(const v8::WeakCallbackInfo<CJS_Object>& data) {
58 CJS_Object* pJSObj = data.GetParameter(); 58 CJS_Object* pJSObj = data.GetParameter();
59 pJSObj->Dispose(); 59 pJSObj->Dispose();
60 data.SetSecondPassCallback(FreeObject); 60 data.SetSecondPassCallback(FreeObject);
61 } 61 }
62 62
63 CJS_Object::CJS_Object(v8::Local<v8::Object> pObject) { 63 CJS_Object::CJS_Object(v8::Local<v8::Object> pObject) {
64 m_pIsolate = pObject->CreationContext()->GetIsolate(); 64 m_pIsolate = pObject->GetIsolate();
65 m_pV8Object.Reset(m_pIsolate, pObject); 65 m_pV8Object.Reset(m_pIsolate, pObject);
66 } 66 }
67 67
68 CJS_Object::~CJS_Object() { 68 CJS_Object::~CJS_Object() {
69 } 69 }
70 70
71 void CJS_Object::MakeWeak() { 71 void CJS_Object::MakeWeak() {
72 m_pV8Object.SetWeak(this, DisposeObject, 72 m_pV8Object.SetWeak(this, DisposeObject,
73 v8::WeakCallbackType::kInternalFields); 73 v8::WeakCallbackType::kInternalFields);
74 } 74 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // static 151 // static
152 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { 152 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() {
153 // Leak the timer array at shutdown. 153 // Leak the timer array at shutdown.
154 static auto* s_TimerMap = new TimerMap; 154 static auto* s_TimerMap = new TimerMap;
155 return s_TimerMap; 155 return s_TimerMap;
156 } 156 }
157 157
158 void CJS_Timer::OnDestroyed() { 158 void CJS_Timer::OnDestroyed() {
159 m_bValid = false; 159 m_bValid = false;
160 } 160 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/global.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698