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

Side by Side Diff: ppapi/examples/printing/printing.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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
« no previous file with comments | « ppapi/examples/ime/ime.cc ('k') | ppapi/examples/video_decode/video_decode.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « ppapi/examples/ime/ime.cc ('k') | ppapi/examples/video_decode/video_decode.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698