| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // NOTE: New trait definitions that will be used by Chrome Frame must be placed | 5 // NOTE: New trait definitions that will be used by Chrome Frame must be placed |
| 6 // in common_param_traits2.cc. | 6 // in common_param_traits2.cc. |
| 7 | 7 |
| 8 #include "content/public/common/webkit_param_traits.h" | 8 #include "content/public/common/webkit_param_traits.h" |
| 9 | 9 |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "content/public/common/common_param_traits.h" | 11 #include "content/public/common/common_param_traits.h" |
| 12 #include "content/public/common/content_constants.h" | 12 #include "content/public/common/content_constants.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
| 14 #include "webkit/glue/password_form.h" | 14 #include "webkit/glue/password_form.h" |
| 15 #include "webkit/glue/resource_loader_bridge.h" | 15 #include "webkit/glue/resource_loader_bridge.h" |
| 16 #include "webkit/plugins/npapi/plugin_host.h" |
| 16 | 17 |
| 17 NPIdentifier_Param::NPIdentifier_Param() | 18 NPIdentifier_Param::NPIdentifier_Param() |
| 18 : identifier() { | 19 : identifier() { |
| 19 } | 20 } |
| 20 | 21 |
| 21 NPIdentifier_Param::~NPIdentifier_Param() { | 22 NPIdentifier_Param::~NPIdentifier_Param() { |
| 22 } | 23 } |
| 23 | 24 |
| 24 NPVariant_Param::NPVariant_Param() | 25 NPVariant_Param::NPVariant_Param() |
| 25 : type(NPVARIANT_PARAM_VOID), | 26 : type(NPVARIANT_PARAM_VOID), |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 bool ParamTraits<NPIdentifier_Param>::Read(const Message* m, | 228 bool ParamTraits<NPIdentifier_Param>::Read(const Message* m, |
| 228 void** iter, | 229 void** iter, |
| 229 param_type* r) { | 230 param_type* r) { |
| 230 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); | 231 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); |
| 231 } | 232 } |
| 232 | 233 |
| 233 void ParamTraits<NPIdentifier_Param>::Log(const param_type& p, std::string* l) { | 234 void ParamTraits<NPIdentifier_Param>::Log(const param_type& p, std::string* l) { |
| 234 if (WebKit::WebBindings::identifierIsString(p.identifier)) { | 235 if (WebKit::WebBindings::identifierIsString(p.identifier)) { |
| 235 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); | 236 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); |
| 236 l->append(str); | 237 l->append(str); |
| 237 NPN_MemFree(str); | 238 webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(str); |
| 238 } else { | 239 } else { |
| 239 l->append(base::IntToString( | 240 l->append(base::IntToString( |
| 240 WebKit::WebBindings::intFromIdentifier(p.identifier))); | 241 WebKit::WebBindings::intFromIdentifier(p.identifier))); |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 | 244 |
| 244 void ParamTraits<webkit::WebPluginMimeType>::Write(Message* m, | 245 void ParamTraits<webkit::WebPluginMimeType>::Write(Message* m, |
| 245 const param_type& p) { | 246 const param_type& p) { |
| 246 WriteParam(m, p.mime_type); | 247 WriteParam(m, p.mime_type); |
| 247 WriteParam(m, p.file_extensions); | 248 WriteParam(m, p.file_extensions); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 ReadParam(m, iter, &p->ssl_valid) && | 339 ReadParam(m, iter, &p->ssl_valid) && |
| 339 ReadParam(m, iter, &p->preferred) && | 340 ReadParam(m, iter, &p->preferred) && |
| 340 ReadParam(m, iter, &p->blacklisted_by_user); | 341 ReadParam(m, iter, &p->blacklisted_by_user); |
| 341 } | 342 } |
| 342 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, | 343 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, |
| 343 std::string* l) { | 344 std::string* l) { |
| 344 l->append("<PasswordForm>"); | 345 l->append("<PasswordForm>"); |
| 345 } | 346 } |
| 346 | 347 |
| 347 } // namespace IPC | 348 } // namespace IPC |
| OLD | NEW |