| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include "ppapi/cpp/dev/buffer_dev.h" | 7 #include "ppapi/cpp/dev/buffer_dev.h" |
| 8 #include "ppapi/cpp/dev/printing_dev.h" | 8 #include "ppapi/cpp/dev/printing_dev.h" |
| 9 #include "ppapi/cpp/image_data.h" | 9 #include "ppapi/cpp/image_data.h" |
| 10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) { | 62 virtual int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) { |
| 63 return 1; | 63 return 1; |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual pp::Resource PrintPages( | 66 virtual pp::Resource PrintPages( |
| 67 const PP_PrintPageNumberRange_Dev* page_ranges, | 67 const PP_PrintPageNumberRange_Dev* page_ranges, |
| 68 uint32_t page_range_count) { | 68 uint32_t page_range_count) { |
| 69 size_t pdf_len = strlen(pdf_data); | 69 size_t pdf_len = strlen(pdf_data); |
| 70 pp::Buffer_Dev buffer(this, pdf_len); | 70 pp::Buffer_Dev buffer(this, static_cast<uint32_t>(pdf_len)); |
| 71 | 71 |
| 72 memcpy(buffer.data(), pdf_data, pdf_len); | 72 memcpy(buffer.data(), pdf_data, pdf_len); |
| 73 return buffer; | 73 return buffer; |
| 74 } | 74 } |
| 75 | 75 |
| 76 virtual void PrintEnd() { | 76 virtual void PrintEnd() { |
| 77 } | 77 } |
| 78 | 78 |
| 79 virtual bool IsPrintScalingDisabled() { | 79 virtual bool IsPrintScalingDisabled() { |
| 80 return true; | 80 return true; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 94 | 94 |
| 95 namespace pp { | 95 namespace pp { |
| 96 | 96 |
| 97 // Factory function for your specialization of the Module object. | 97 // Factory function for your specialization of the Module object. |
| 98 Module* CreateModule() { | 98 Module* CreateModule() { |
| 99 return new MyModule(); | 99 return new MyModule(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace pp | 102 } // namespace pp |
| 103 | 103 |
| OLD | NEW |