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

Side by Side Diff: third_party/WebKit/Source/web/WebBindings.cpp

Issue 1483733002: Remove support for NPObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "public/web/WebBindings.h" 31 #include "public/web/WebBindings.h"
32 32
33 #include "bindings/core/v8/NPV8Object.h"
34 #include "bindings/core/v8/npruntime_impl.h"
35 #include "bindings/core/v8/npruntime_priv.h"
36
37 namespace blink { 33 namespace blink {
38 34
39 bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, ui nt32_t argCount, NPVariant* result) 35 bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, ui nt32_t argCount, NPVariant* result)
tkent 2016/03/29 06:01:04 Don't you remove WebBindings entirely?
dcheng 2016/03/29 07:04:15 I'm planning on trying that in a follow up since t
tkent 2016/03/29 07:38:57 Ok, that's fine.
40 { 36 {
41 return _NPN_Construct(npp, object, args, argCount, result); 37 return false;
42 } 38 }
43 39
44 NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) 40 NPObject* WebBindings::createObject(NPP npp, NPClass* npClass)
45 { 41 {
46 return _NPN_CreateObject(npp, npClass); 42 return nullptr;
47 } 43 }
48 44
49 bool WebBindings::enumerate(NPP npp, NPObject* object, NPIdentifier** identifier , uint32_t* identifierCount) 45 bool WebBindings::enumerate(NPP npp, NPObject* object, NPIdentifier** identifier , uint32_t* identifierCount)
50 { 46 {
51 return _NPN_Enumerate(npp, object, identifier, identifierCount); 47 return false;
52 } 48 }
53 49
54 bool WebBindings::evaluate(NPP npp, NPObject* object, NPString* script, NPVarian t* result) 50 bool WebBindings::evaluate(NPP npp, NPObject* object, NPString* script, NPVarian t* result)
55 { 51 {
56 return _NPN_Evaluate(npp, object, script, result); 52 return false;
57 }
58
59 bool WebBindings::evaluateHelper(NPP npp, bool popupsAllowed, NPObject* object, NPString* script, NPVariant* result)
60 {
61 return _NPN_EvaluateHelper(npp, popupsAllowed, object, script, result);
62 } 53 }
63 54
64 NPIdentifier WebBindings::getIntIdentifier(int32_t number) 55 NPIdentifier WebBindings::getIntIdentifier(int32_t number)
65 { 56 {
66 return _NPN_GetIntIdentifier(number); 57 return nullptr;
67 } 58 }
68 59
69 bool WebBindings::getProperty(NPP npp, NPObject* object, NPIdentifier property, NPVariant* result) 60 bool WebBindings::getProperty(NPP npp, NPObject* object, NPIdentifier property, NPVariant* result)
70 { 61 {
71 return _NPN_GetProperty(npp, object, property, result); 62 return false;
72 } 63 }
73 64
74 NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string) 65 NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string)
75 { 66 {
76 return _NPN_GetStringIdentifier(string); 67 return nullptr;
77 } 68 }
78 69
79 void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers) 70 void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers)
80 { 71 {
81 _NPN_GetStringIdentifiers(names, nameCount, identifiers);
82 } 72 }
83 73
84 bool WebBindings::hasMethod(NPP npp, NPObject* object, NPIdentifier method) 74 bool WebBindings::hasMethod(NPP npp, NPObject* object, NPIdentifier method)
85 { 75 {
86 return _NPN_HasMethod(npp, object, method); 76 return false;
87 } 77 }
88 78
89 bool WebBindings::hasProperty(NPP npp, NPObject* object, NPIdentifier property) 79 bool WebBindings::hasProperty(NPP npp, NPObject* object, NPIdentifier property)
90 { 80 {
91 return _NPN_HasProperty(npp, object, property); 81 return false;
92 } 82 }
93 83
94 bool WebBindings::identifierIsString(NPIdentifier identifier) 84 bool WebBindings::identifierIsString(NPIdentifier identifier)
95 { 85 {
96 return _NPN_IdentifierIsString(identifier); 86 return false;
97 } 87 }
98 88
99 int32_t WebBindings::intFromIdentifier(NPIdentifier identifier) 89 int32_t WebBindings::intFromIdentifier(NPIdentifier identifier)
100 { 90 {
101 return _NPN_IntFromIdentifier(identifier); 91 return 0;
102 } 92 }
103 93
104 bool WebBindings::invoke(NPP npp, NPObject* object, NPIdentifier method, const N PVariant* args, uint32_t argCount, NPVariant* result) 94 bool WebBindings::invoke(NPP npp, NPObject* object, NPIdentifier method, const N PVariant* args, uint32_t argCount, NPVariant* result)
105 { 95 {
106 return _NPN_Invoke(npp, object, method, args, argCount, result); 96 return false;
107 } 97 }
108 98
109 bool WebBindings::invokeDefault(NPP npp, NPObject* object, const NPVariant* args , uint32_t argCount, NPVariant* result) 99 bool WebBindings::invokeDefault(NPP npp, NPObject* object, const NPVariant* args , uint32_t argCount, NPVariant* result)
110 { 100 {
111 return _NPN_InvokeDefault(npp, object, args, argCount, result); 101 return false;
112 } 102 }
113 103
114 void WebBindings::releaseObject(NPObject* object) 104 void WebBindings::releaseObject(NPObject* object)
115 { 105 {
116 return _NPN_ReleaseObject(object);
117 } 106 }
118 107
119 void WebBindings::releaseVariantValue(NPVariant* variant) 108 void WebBindings::releaseVariantValue(NPVariant* variant)
120 { 109 {
121 _NPN_ReleaseVariantValue(variant);
122 } 110 }
123 111
124 bool WebBindings::removeProperty(NPP npp, NPObject* object, NPIdentifier identif ier) 112 bool WebBindings::removeProperty(NPP npp, NPObject* object, NPIdentifier identif ier)
125 { 113 {
126 return _NPN_RemoveProperty(npp, object, identifier); 114 return false;
127 } 115 }
128 116
129 NPObject* WebBindings::retainObject(NPObject* object) 117 NPObject* WebBindings::retainObject(NPObject* object)
130 { 118 {
131 return _NPN_RetainObject(object); 119 return nullptr;
132 } 120 }
133 121
134 void WebBindings::setException(NPObject* object, const NPUTF8* message) 122 void WebBindings::setException(NPObject* object, const NPUTF8* message)
135 { 123 {
136 _NPN_SetException(object, message);
137 } 124 }
138 125
139 bool WebBindings::setProperty(NPP npp, NPObject* object, NPIdentifier identifier , const NPVariant* value) 126 bool WebBindings::setProperty(NPP npp, NPObject* object, NPIdentifier identifier , const NPVariant* value)
140 { 127 {
141 return _NPN_SetProperty(npp, object, identifier, value); 128 return false;
142 } 129 }
143 130
144 NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier) 131 NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier)
145 { 132 {
146 return _NPN_UTF8FromIdentifier(identifier); 133 return nullptr;
147 }
148
149 void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NP UTF8*& string, int32_t& number, bool& isString)
150 {
151 PrivateIdentifier* data = static_cast<PrivateIdentifier*>(identifier);
152 if (!data) {
153 isString = false;
154 number = 0;
155 return;
156 }
157
158 isString = data->isString;
159 if (isString)
160 string = data->value.string;
161 else
162 number = data->value.number;
163 } 134 }
164 135
165 } // namespace blink 136 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/FocusController.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698