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

Side by Side Diff: gpu/np_utils/np_browser.cc

Issue 481007: Deleted np_utils library. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 | « gpu/np_utils/np_browser.h ('k') | gpu/np_utils/np_browser_mock.h » ('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) 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 "gpu/np_utils/np_browser.h"
6 #include "base/logging.h"
7 #include "webkit/glue/plugins/nphostapi.h"
8
9 namespace np_utils {
10
11 NPBrowser* NPBrowser::browser_;
12
13 NPBrowser::NPBrowser(NPNetscapeFuncs* funcs)
14 : netscape_funcs_(funcs) {
15 // Make this the first browser in the linked list.
16 previous_browser_ = browser_;
17 browser_ = this;
18 }
19
20 NPBrowser::~NPBrowser() {
21 // Remove this browser from the linked list.
22 DCHECK(browser_ == this);
23 browser_ = previous_browser_;
24 }
25
26 NPIdentifier NPBrowser::GetStringIdentifier(const NPUTF8* name) {
27 return netscape_funcs_->getstringidentifier(name);
28 }
29
30 void* NPBrowser::MemAlloc(size_t size) {
31 return netscape_funcs_->memalloc(size);
32 }
33
34 void NPBrowser::MemFree(void* p) {
35 netscape_funcs_->memfree(p);
36 }
37
38 NPObject* NPBrowser::CreateObject(NPP npp, const NPClass* cl) {
39 return netscape_funcs_->createobject(npp, const_cast<NPClass*>(cl));
40 }
41
42 NPObject* NPBrowser::RetainObject(NPObject* object) {
43 return netscape_funcs_->retainobject(object);
44 }
45
46 void NPBrowser::ReleaseObject(NPObject* object) {
47 netscape_funcs_->releaseobject(object);
48 }
49
50 void NPBrowser::ReleaseVariantValue(NPVariant* variant) {
51 netscape_funcs_->releasevariantvalue(variant);
52 }
53
54 bool NPBrowser::HasProperty(NPP npp,
55 NPObject* object,
56 NPIdentifier name) {
57 return netscape_funcs_->hasproperty(npp, object, name);
58 }
59
60 bool NPBrowser::GetProperty(NPP npp,
61 NPObject* object,
62 NPIdentifier name,
63 NPVariant* result) {
64 return netscape_funcs_->getproperty(npp, object, name, result);
65 }
66
67 bool NPBrowser::SetProperty(NPP npp,
68 NPObject* object,
69 NPIdentifier name,
70 const NPVariant* result) {
71 return netscape_funcs_->setproperty(npp, object, name, result);
72 }
73
74 bool NPBrowser::RemoveProperty(NPP npp,
75 NPObject* object,
76 NPIdentifier name) {
77 return netscape_funcs_->removeproperty(npp, object, name);
78 }
79
80 bool NPBrowser::HasMethod(NPP npp,
81 NPObject* object,
82 NPIdentifier name) {
83 return netscape_funcs_->hasmethod(npp, object, name);
84 }
85
86 bool NPBrowser::Invoke(NPP npp,
87 NPObject* object,
88 NPIdentifier name,
89 const NPVariant* args,
90 uint32_t num_args,
91 NPVariant* result) {
92 return netscape_funcs_->invoke(npp, object, name, args, num_args, result);
93 }
94
95 NPObject* NPBrowser::GetWindowNPObject(NPP npp) {
96 NPObject* window;
97 if (NPERR_NO_ERROR == netscape_funcs_->getvalue(npp,
98 NPNVWindowNPObject,
99 &window)) {
100 return window;
101 } else {
102 return NULL;
103 }
104 }
105
106 void NPBrowser::PluginThreadAsyncCall(NPP npp,
107 PluginThreadAsyncCallProc callback,
108 void* data) {
109 netscape_funcs_->pluginthreadasynccall(npp, callback, data);
110 }
111
112 uint32 NPBrowser::ScheduleTimer(NPP npp,
113 uint32 interval,
114 bool repeat,
115 TimerProc callback) {
116 return netscape_funcs_->scheduletimer(npp, interval, repeat, callback);
117 }
118
119 void NPBrowser::UnscheduleTimer(NPP npp, uint32 timer_id) {
120 netscape_funcs_->unscheduletimer(npp, timer_id);
121 }
122
123 } // namespace np_utils
OLDNEW
« no previous file with comments | « gpu/np_utils/np_browser.h ('k') | gpu/np_utils/np_browser_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698