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

Unified Diff: fpdfsdk/javascript/cjs_context.h

Issue 2173253002: Use smart pointers for class owned pointers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/fsdk_mgr.h ('k') | fpdfsdk/javascript/cjs_context.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/cjs_context.h
diff --git a/fpdfsdk/javascript/cjs_context.h b/fpdfsdk/javascript/cjs_context.h
index cccdbc7669e33d55443fc849effcc0dc79c4bb9f..49ba42c6d186e05c9381c21d6643c843ba76351a 100644
--- a/fpdfsdk/javascript/cjs_context.h
+++ b/fpdfsdk/javascript/cjs_context.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_
#define FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_
+#include <memory>
+
#include "core/fxcrt/include/fx_string.h"
#include "core/fxcrt/include/fx_system.h"
#include "fpdfsdk/javascript/ijs_context.h"
@@ -121,14 +123,14 @@ class CJS_Context : public IJS_Context {
void OnExternal_Exec() override;
CJS_Runtime* GetJSRuntime() const { return m_pRuntime; }
- CJS_EventHandler* GetEventHandler() const { return m_pEventHandler; }
+ CJS_EventHandler* GetEventHandler() const { return m_pEventHandler.get(); }
CPDFDoc_Environment* GetReaderApp();
CPDFSDK_Document* GetReaderDocument();
private:
- CJS_Runtime* m_pRuntime;
- CJS_EventHandler* m_pEventHandler;
+ CJS_Runtime* const m_pRuntime;
+ std::unique_ptr<CJS_EventHandler> m_pEventHandler;
FX_BOOL m_bBusy;
};
« no previous file with comments | « fpdfsdk/include/fsdk_mgr.h ('k') | fpdfsdk/javascript/cjs_context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698