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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 "chrome_frame/chrome_frame_npapi.h"
6
7 #define NPAPI WINAPI
8
9 // Plugin entry points.
10 extern "C" {
11 NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs);
12 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs);
13 void NPAPI NP_Shutdown();
14 }
15
16 NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs) {
17 DLOG(INFO) << __FUNCTION__;
18 _pAtlModule->Lock();
19 npapi::InitializeBrowserFunctions(browser_funcs);
20 return NPERR_NO_ERROR;
21 }
22
23 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) {
24 plugin_funcs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
25 plugin_funcs->size = sizeof(plugin_funcs);
26 plugin_funcs->newp = NPP_New;
27 plugin_funcs->destroy = NPP_Destroy;
28 plugin_funcs->setwindow = NPP_SetWindow;
29 plugin_funcs->newstream = NPP_NewStream;
30 plugin_funcs->destroystream = NPP_DestroyStream;
31 plugin_funcs->asfile = NULL;
32 plugin_funcs->writeready = NPP_WriteReady;
33 plugin_funcs->write = NPP_Write;
34 plugin_funcs->print = NPP_Print;
35 plugin_funcs->event = NULL;
36 plugin_funcs->urlnotify = NPP_URLNotify;
37 plugin_funcs->getvalue = NPP_GetValue;
38 plugin_funcs->setvalue = NPP_SetValue;
39 return NPERR_NO_ERROR;
40 }
41
42 void NPAPI NP_Shutdown() {
43 DLOG(INFO) << __FUNCTION__;
44
45 npapi::UninitializeBrowserFunctions();
46
47 _pAtlModule->Unlock(); // matches Lock() inside NP_Initialize
48
49 DLOG_IF(ERROR, _pAtlModule->GetLockCount() != 0)
50 << "Being shut down but still have " << _pAtlModule->GetLockCount()
51 << " living objects";
52 }
53
OLDNEW
« 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