xref: /aosp_15_r20/external/pdfium/xfa/fwl/cfwl_app.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2014 The PDFium Authors
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 "xfa/fwl/cfwl_app.h"
8 
9 #include "v8/include/cppgc/allocation.h"
10 #include "xfa/fwl/cfwl_notedriver.h"
11 #include "xfa/fwl/cfwl_widget.h"
12 #include "xfa/fwl/cfwl_widgetmgr.h"
13 
CFWL_App(AdapterIface * pAdapter)14 CFWL_App::CFWL_App(AdapterIface* pAdapter)
15     : m_pAdapter(pAdapter),
16       m_pWidgetMgr(cppgc::MakeGarbageCollected<CFWL_WidgetMgr>(
17           pAdapter->GetHeap()->GetAllocationHandle(),
18           pAdapter->GetWidgetMgrAdapter(),
19           this)),
20       m_pNoteDriver(cppgc::MakeGarbageCollected<CFWL_NoteDriver>(
21           pAdapter->GetHeap()->GetAllocationHandle(),
22           this)) {}
23 
24 CFWL_App::~CFWL_App() = default;
25 
Trace(cppgc::Visitor * visitor) const26 void CFWL_App::Trace(cppgc::Visitor* visitor) const {
27   visitor->Trace(m_pAdapter);
28   visitor->Trace(m_pWidgetMgr);
29   visitor->Trace(m_pNoteDriver);
30 }
31