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

Unified Diff: chrome_frame/chrome_frame_npapi_entrypoints.cc

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « chrome_frame/chrome_frame_npapi.rgs ('k') | chrome_frame/chrome_frame_npapi_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_frame_npapi_entrypoints.cc
===================================================================
--- chrome_frame/chrome_frame_npapi_entrypoints.cc (revision 0)
+++ chrome_frame/chrome_frame_npapi_entrypoints.cc (revision 0)
@@ -0,0 +1,53 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome_frame/chrome_frame_npapi.h"
+
+#define NPAPI WINAPI
+
+// Plugin entry points.
+extern "C" {
+ NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs);
+ NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs);
+ void NPAPI NP_Shutdown();
+}
+
+NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs) {
+ DLOG(INFO) << __FUNCTION__;
+ _pAtlModule->Lock();
+ npapi::InitializeBrowserFunctions(browser_funcs);
+ return NPERR_NO_ERROR;
+}
+
+NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) {
+ plugin_funcs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
+ plugin_funcs->size = sizeof(plugin_funcs);
+ plugin_funcs->newp = NPP_New;
+ plugin_funcs->destroy = NPP_Destroy;
+ plugin_funcs->setwindow = NPP_SetWindow;
+ plugin_funcs->newstream = NPP_NewStream;
+ plugin_funcs->destroystream = NPP_DestroyStream;
+ plugin_funcs->asfile = NULL;
+ plugin_funcs->writeready = NPP_WriteReady;
+ plugin_funcs->write = NPP_Write;
+ plugin_funcs->print = NPP_Print;
+ plugin_funcs->event = NULL;
+ plugin_funcs->urlnotify = NPP_URLNotify;
+ plugin_funcs->getvalue = NPP_GetValue;
+ plugin_funcs->setvalue = NPP_SetValue;
+ return NPERR_NO_ERROR;
+}
+
+void NPAPI NP_Shutdown() {
+ DLOG(INFO) << __FUNCTION__;
+
+ npapi::UninitializeBrowserFunctions();
+
+ _pAtlModule->Unlock(); // matches Lock() inside NP_Initialize
+
+ DLOG_IF(ERROR, _pAtlModule->GetLockCount() != 0)
+ << "Being shut down but still have " << _pAtlModule->GetLockCount()
+ << " living objects";
+}
+
« no previous file with comments | « chrome_frame/chrome_frame_npapi.rgs ('k') | chrome_frame/chrome_frame_npapi_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698