OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ppapi/proxy/pdf_resource.h" | 5 #include "ppapi/proxy/pdf_resource.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 status = U_ZERO_ERROR; | 86 status = U_ZERO_ERROR; |
87 int match_start = usearch_first(searcher, &status); | 87 int match_start = usearch_first(searcher, &status); |
88 DCHECK(status == U_ZERO_ERROR); | 88 DCHECK(status == U_ZERO_ERROR); |
89 | 89 |
90 std::vector<PP_PrivateFindResult> pp_results; | 90 std::vector<PP_PrivateFindResult> pp_results; |
91 while (match_start != USEARCH_DONE) { | 91 while (match_start != USEARCH_DONE) { |
92 size_t matched_length = usearch_getMatchedLength(searcher); | 92 size_t matched_length = usearch_getMatchedLength(searcher); |
93 PP_PrivateFindResult result; | 93 PP_PrivateFindResult result; |
94 result.start_index = match_start; | 94 result.start_index = match_start; |
95 result.length = matched_length; | 95 result.length = static_cast<uint32_t>(matched_length); |
96 pp_results.push_back(result); | 96 pp_results.push_back(result); |
97 match_start = usearch_next(searcher, &status); | 97 match_start = usearch_next(searcher, &status); |
98 DCHECK(status == U_ZERO_ERROR); | 98 DCHECK(status == U_ZERO_ERROR); |
99 } | 99 } |
100 | 100 |
101 *count = pp_results.size(); | 101 *count = static_cast<uint32_t>(pp_results.size()); |
102 if (*count) { | 102 if (*count) { |
103 *results = reinterpret_cast<PP_PrivateFindResult*>(malloc( | 103 *results = reinterpret_cast<PP_PrivateFindResult*>(malloc( |
104 *count * sizeof(PP_PrivateFindResult))); | 104 *count * sizeof(PP_PrivateFindResult))); |
105 memcpy(*results, &pp_results[0], *count * sizeof(PP_PrivateFindResult)); | 105 memcpy(*results, &pp_results[0], *count * sizeof(PP_PrivateFindResult)); |
106 } else { | 106 } else { |
107 *results = NULL; | 107 *results = NULL; |
108 } | 108 } |
109 | 109 |
110 usearch_close(searcher); | 110 usearch_close(searcher); |
111 } | 111 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, | 209 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, |
210 int* natives_size_out, | 210 int* natives_size_out, |
211 const char** snapshot_data_out, | 211 const char** snapshot_data_out, |
212 int* snapshot_size_out) { | 212 int* snapshot_size_out) { |
213 gin::IsolateHolder::GetV8ExternalSnapshotData(natives_data_out, | 213 gin::IsolateHolder::GetV8ExternalSnapshotData(natives_data_out, |
214 natives_size_out, snapshot_data_out, snapshot_size_out); | 214 natives_size_out, snapshot_data_out, snapshot_size_out); |
215 } | 215 } |
216 | 216 |
217 } // namespace proxy | 217 } // namespace proxy |
218 } // namespace ppapi | 218 } // namespace ppapi |
OLD | NEW |