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

Side by Side Diff: fxjse/runtime.cpp

Issue 2127553004: Roll DEPS for v8 to 820a23aa. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « fxjse/context.cpp ('k') | no next file » | 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 "fxjse/runtime.h" 7 #include "fxjse/runtime.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 CFXJSE_RuntimeData::CFXJSE_RuntimeData(v8::Isolate* pIsolate) 72 CFXJSE_RuntimeData::CFXJSE_RuntimeData(v8::Isolate* pIsolate)
73 : m_pIsolate(pIsolate) {} 73 : m_pIsolate(pIsolate) {}
74 74
75 CFXJSE_RuntimeData::~CFXJSE_RuntimeData() {} 75 CFXJSE_RuntimeData::~CFXJSE_RuntimeData() {}
76 76
77 CFXJSE_RuntimeData* CFXJSE_RuntimeData::Create(v8::Isolate* pIsolate) { 77 CFXJSE_RuntimeData* CFXJSE_RuntimeData::Create(v8::Isolate* pIsolate) {
78 CFXJSE_RuntimeData* pRuntimeData = new CFXJSE_RuntimeData(pIsolate); 78 CFXJSE_RuntimeData* pRuntimeData = new CFXJSE_RuntimeData(pIsolate);
79 CFXJSE_ScopeUtil_IsolateHandle scope(pIsolate); 79 CFXJSE_ScopeUtil_IsolateHandle scope(pIsolate);
80 v8::Local<v8::FunctionTemplate> hFuncTemplate = 80 v8::Local<v8::FunctionTemplate> hFuncTemplate =
81 v8::FunctionTemplate::New(pIsolate); 81 v8::FunctionTemplate::New(pIsolate);
82 v8::Local<v8::ObjectTemplate> hGlobalTemplate =
83 hFuncTemplate->InstanceTemplate();
84 hGlobalTemplate->Set(
85 v8::Symbol::GetToStringTag(pIsolate),
86 v8::String::NewFromUtf8(pIsolate, "global", v8::NewStringType::kNormal)
87 .ToLocalChecked());
82 v8::Local<v8::Context> hContext = 88 v8::Local<v8::Context> hContext =
83 v8::Context::New(pIsolate, 0, hFuncTemplate->InstanceTemplate()); 89 v8::Context::New(pIsolate, 0, hGlobalTemplate);
84 hContext->SetSecurityToken(v8::External::New(pIsolate, pIsolate)); 90 hContext->SetSecurityToken(v8::External::New(pIsolate, pIsolate));
85 pRuntimeData->m_hRootContextGlobalTemplate.Reset(pIsolate, hFuncTemplate); 91 pRuntimeData->m_hRootContextGlobalTemplate.Reset(pIsolate, hFuncTemplate);
86 pRuntimeData->m_hRootContext.Reset(pIsolate, hContext); 92 pRuntimeData->m_hRootContext.Reset(pIsolate, hContext);
87 return pRuntimeData; 93 return pRuntimeData;
88 } 94 }
89 95
90 CFXJSE_RuntimeData* CFXJSE_RuntimeData::Get(v8::Isolate* pIsolate) { 96 CFXJSE_RuntimeData* CFXJSE_RuntimeData::Get(v8::Isolate* pIsolate) {
91 FXJS_PerIsolateData::SetUp(pIsolate); 97 FXJS_PerIsolateData::SetUp(pIsolate);
92 FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate); 98 FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate);
93 if (!pData->m_pFXJSERuntimeData) 99 if (!pData->m_pFXJSERuntimeData)
(...skipping 21 matching lines...) Expand all
115 lpfnDisposeCallback(pIsolate, bFound); 121 lpfnDisposeCallback(pIsolate, bFound);
116 } 122 }
117 123
118 void CFXJSE_IsolateTracker::RemoveAll( 124 void CFXJSE_IsolateTracker::RemoveAll(
119 CFXJSE_IsolateTracker::DisposeCallback lpfnDisposeCallback) { 125 CFXJSE_IsolateTracker::DisposeCallback lpfnDisposeCallback) {
120 for (v8::Isolate* pIsolate : m_OwnedIsolates) 126 for (v8::Isolate* pIsolate : m_OwnedIsolates)
121 lpfnDisposeCallback(pIsolate, true); 127 lpfnDisposeCallback(pIsolate, true);
122 128
123 m_OwnedIsolates.clear(); 129 m_OwnedIsolates.clear();
124 } 130 }
OLDNEW
« no previous file with comments | « fxjse/context.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698