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

Side by Side Diff: content/common/webkit_param_traits.cc

Issue 7990005: Use a placeholder instead of the default plugin for missing plug-ins on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 9 years, 2 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 | « content/common/webkit_param_traits.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/webkit_param_traits.h" 8 #include "content/common/webkit_param_traits.h"
9 9
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (WebKit::WebBindings::identifierIsString(p.identifier)) { 334 if (WebKit::WebBindings::identifierIsString(p.identifier)) {
335 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); 335 NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier);
336 l->append(str); 336 l->append(str);
337 NPN_MemFree(str); 337 NPN_MemFree(str);
338 } else { 338 } else {
339 l->append(base::IntToString( 339 l->append(base::IntToString(
340 WebKit::WebBindings::intFromIdentifier(p.identifier))); 340 WebKit::WebBindings::intFromIdentifier(p.identifier)));
341 } 341 }
342 } 342 }
343 343
344 void ParamTraits<webkit::WebPluginMimeType>::Write(Message* m,
345 const param_type& p) {
346 WriteParam(m, p.mime_type);
347 WriteParam(m, p.file_extensions);
348 WriteParam(m, p.description);
349 WriteParam(m, p.additional_param_names);
350 WriteParam(m, p.additional_param_values);
351 }
352
353 bool ParamTraits<webkit::WebPluginMimeType>::Read(const Message* m,
354 void** iter,
355 param_type* p) {
356 return
357 ReadParam(m, iter, &p->mime_type) &&
358 ReadParam(m, iter, &p->file_extensions) &&
359 ReadParam(m, iter, &p->description) &&
360 ReadParam(m, iter, &p->additional_param_names) &&
361 ReadParam(m, iter, &p->additional_param_values);
362 }
363
364 void ParamTraits<webkit::WebPluginMimeType>::Log(
365 const param_type& p, std::string* l) {
366 l->append("(");
367 LogParam(p.mime_type, l); l->append(", ");
368 LogParam(p.file_extensions, l); l->append(", ");
369 LogParam(p.description, l); l->append(", ");
370 LogParam(p.additional_param_names, l); l->append(", ");
371 LogParam(p.additional_param_values, l);
372 l->append(")");
373 }
374
375 void ParamTraits<webkit::WebPluginInfo>::Write(Message* m,
376 const param_type& p) {
377 WriteParam(m, p.name);
378 WriteParam(m, p.path);
379 WriteParam(m, p.version);
380 WriteParam(m, p.desc);
381 WriteParam(m, p.mime_types);
382 WriteParam(m, p.type);
383 }
384
385 bool ParamTraits<webkit::WebPluginInfo>::Read(const Message* m,
386 void** iter,
387 param_type* p) {
388 return
389 ReadParam(m, iter, &p->name) &&
390 ReadParam(m, iter, &p->path) &&
391 ReadParam(m, iter, &p->version) &&
392 ReadParam(m, iter, &p->desc) &&
393 ReadParam(m, iter, &p->mime_types) &&
394 ReadParam(m, iter, &p->type);
395 }
396 void ParamTraits<webkit::WebPluginInfo>::Log(const param_type& p,
397 std::string* l) {
398 l->append("(");
399 LogParam(p.name, l); l->append(", ");
400 LogParam(p.path, l); l->append(", ");
401 LogParam(p.version, l); l->append(", ");
402 LogParam(p.desc, l); l->append(", ");
403 LogParam(p.mime_types, l); l->append(", ");
404 LogParam(p.type, l);
405 l->append(")");
406 }
407
344 void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m, 408 void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m,
345 const param_type& p) { 409 const param_type& p) {
346 WriteParam(m, p.signon_realm); 410 WriteParam(m, p.signon_realm);
347 WriteParam(m, p.origin); 411 WriteParam(m, p.origin);
348 WriteParam(m, p.action); 412 WriteParam(m, p.action);
349 WriteParam(m, p.submit_element); 413 WriteParam(m, p.submit_element);
350 WriteParam(m, p.username_element); 414 WriteParam(m, p.username_element);
351 WriteParam(m, p.username_value); 415 WriteParam(m, p.username_value);
352 WriteParam(m, p.password_element); 416 WriteParam(m, p.password_element);
353 WriteParam(m, p.password_value); 417 WriteParam(m, p.password_value);
(...skipping 20 matching lines...) Expand all
374 ReadParam(m, iter, &p->ssl_valid) && 438 ReadParam(m, iter, &p->ssl_valid) &&
375 ReadParam(m, iter, &p->preferred) && 439 ReadParam(m, iter, &p->preferred) &&
376 ReadParam(m, iter, &p->blacklisted_by_user); 440 ReadParam(m, iter, &p->blacklisted_by_user);
377 } 441 }
378 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, 442 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p,
379 std::string* l) { 443 std::string* l) {
380 l->append("<PasswordForm>"); 444 l->append("<PasswordForm>");
381 } 445 }
382 446
383 } // namespace IPC 447 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/webkit_param_traits.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698