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 #include "chrome/common/common_param_traits.h" | 5 #include "chrome/common/common_param_traits.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
9 #include "chrome/common/content_settings.h" | 9 #include "chrome/common/content_settings.h" |
10 #include "chrome/common/thumbnail_score.h" | 10 #include "chrome/common/thumbnail_score.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 buffer.resize(size); | 361 buffer.resize(size); |
362 p.GetData(&buffer.front(), size); | 362 p.GetData(&buffer.front(), size); |
363 } | 363 } |
364 WriteParam(m, buffer); | 364 WriteParam(m, buffer); |
365 } | 365 } |
366 | 366 |
367 bool ParamTraits<printing::NativeMetafile>::Read( | 367 bool ParamTraits<printing::NativeMetafile>::Read( |
368 const Message* m, void** iter, param_type* p) { | 368 const Message* m, void** iter, param_type* p) { |
369 std::vector<uint8> buffer; | 369 std::vector<uint8> buffer; |
370 return ReadParam(m, iter, &buffer) && | 370 return ReadParam(m, iter, &buffer) && |
371 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); | 371 p->InitFromData(&buffer.front(), static_cast<uint32>(buffer.size())); |
372 } | 372 } |
373 | 373 |
374 void ParamTraits<printing::NativeMetafile>::Log( | 374 void ParamTraits<printing::NativeMetafile>::Log( |
375 const param_type& p, std::string* l) { | 375 const param_type& p, std::string* l) { |
376 l->append("<printing::NativeMetafile>"); | 376 l->append("<printing::NativeMetafile>"); |
377 } | 377 } |
378 | 378 |
379 void ParamTraits<printing::PrinterCapsAndDefaults>::Write( | 379 void ParamTraits<printing::PrinterCapsAndDefaults>::Write( |
380 Message* m, const param_type& p) { | 380 Message* m, const param_type& p) { |
381 WriteParam(m, p.printer_capabilities); | 381 WriteParam(m, p.printer_capabilities); |
(...skipping 18 matching lines...) Expand all Loading... |
400 l->append(","); | 400 l->append(","); |
401 LogParam(p.caps_mime_type, l); | 401 LogParam(p.caps_mime_type, l); |
402 l->append(","); | 402 l->append(","); |
403 LogParam(p.printer_defaults, l); | 403 LogParam(p.printer_defaults, l); |
404 l->append(","); | 404 l->append(","); |
405 LogParam(p.defaults_mime_type, l); | 405 LogParam(p.defaults_mime_type, l); |
406 l->append(")"); | 406 l->append(")"); |
407 } | 407 } |
408 | 408 |
409 } // namespace IPC | 409 } // namespace IPC |
OLD | NEW |