| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <windows.h> | |
| 6 | |
| 7 #include "base/at_exit.h" | |
| 8 #include "base/command_line.h" | |
| 9 #include "base/logging.h" | |
| 10 #include "webkit/activex_shim/npp_impl.h" | |
| 11 | |
| 12 base::AtExitManager* g_exit_manager = NULL; | |
| 13 // DLL Entry Point | |
| 14 extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, | |
| 15 LPVOID reserved) { | |
| 16 if (reason == DLL_PROCESS_ATTACH) { | |
| 17 g_exit_manager = new base::AtExitManager(); | |
| 18 #ifdef TRACK_INTERFACE | |
| 19 CommandLine::Init(0, NULL); | |
| 20 | |
| 21 // TODO(ruijiang): Ugly hard-coded path is not good. But we only do it | |
| 22 // for debug build now to trace interface use. Try to find a better place | |
| 23 // later. | |
| 24 logging::InitLogging(L"c:\\activex_shim.log", | |
| 25 logging::LOG_ONLY_TO_FILE, | |
| 26 logging::DONT_LOCK_LOG_FILE, | |
| 27 logging::DELETE_OLD_LOG_FILE); | |
| 28 #endif | |
| 29 } else if (reason == DLL_PROCESS_DETACH) { | |
| 30 delete g_exit_manager; | |
| 31 g_exit_manager = NULL; | |
| 32 } | |
| 33 return TRUE; | |
| 34 } | |
| 35 | |
| 36 NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* funcs) { | |
| 37 return activex_shim::ActiveX_Shim_NP_GetEntryPoints(funcs); | |
| 38 } | |
| 39 | |
| 40 NPError WINAPI NP_Initialize(NPNetscapeFuncs* funcs) { | |
| 41 return activex_shim::ActiveX_Shim_NP_Initialize(funcs); | |
| 42 } | |
| 43 | |
| 44 NPError WINAPI NP_Shutdown(void) { | |
| 45 return activex_shim::ActiveX_Shim_NP_Shutdown(); | |
| 46 } | |
| OLD | NEW |