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 "ppapi/proxy/ppb_pdf_proxy.h" | 5 #include "ppapi/proxy/ppb_pdf_proxy.h" |
6 | 6 |
7 #include <string.h> // For memcpy. | 7 #include <string.h> // For memcpy. |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ppapi/c/private/ppb_pdf.h" | 14 #include "ppapi/c/private/ppb_pdf.h" |
15 #include "ppapi/proxy/plugin_dispatcher.h" | 15 #include "ppapi/proxy/plugin_dispatcher.h" |
16 #include "ppapi/proxy/plugin_resource_tracker.h" | 16 #include "ppapi/proxy/plugin_resource_tracker.h" |
17 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
18 #include "ppapi/thunk/enter.h" | 18 #include "ppapi/thunk/enter.h" |
19 #include "ppapi/thunk/ppb_pdf_api.h" | 19 #include "ppapi/thunk/ppb_pdf_api.h" |
20 | 20 |
21 using ppapi::HostResource; | |
22 using ppapi::Resource; | |
23 using ppapi::thunk::PPB_PDFFont_API; | 21 using ppapi::thunk::PPB_PDFFont_API; |
24 using ppapi::thunk::EnterResource; | 22 using ppapi::thunk::EnterResource; |
25 | 23 |
26 namespace pp { | 24 namespace ppapi { |
27 namespace proxy { | 25 namespace proxy { |
28 | 26 |
29 class PrivateFontFile : public Resource, | 27 class PrivateFontFile : public Resource, |
30 public PPB_PDFFont_API { | 28 public PPB_PDFFont_API { |
31 public: | 29 public: |
32 PrivateFontFile(const HostResource& resource) : Resource(resource) { | 30 PrivateFontFile(const HostResource& resource) : Resource(resource) { |
33 } | 31 } |
34 virtual ~PrivateFontFile() {} | 32 virtual ~PrivateFontFile() {} |
35 | 33 |
36 PPB_PDFFont_API* AsPPB_PDFFont_API() { return this; } | 34 PPB_PDFFont_API* AsPPB_PDFFont_API() { return this; } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if (!ppb_pdf_target()->GetFontTableForPrivateFontFile( | 180 if (!ppb_pdf_target()->GetFontTableForPrivateFontFile( |
183 font_file.host_resource(), table, NULL, &table_length)) | 181 font_file.host_resource(), table, NULL, &table_length)) |
184 return; | 182 return; |
185 | 183 |
186 result->resize(table_length); | 184 result->resize(table_length); |
187 ppb_pdf_target()->GetFontTableForPrivateFontFile(font_file.host_resource(), | 185 ppb_pdf_target()->GetFontTableForPrivateFontFile(font_file.host_resource(), |
188 table, const_cast<char*>(result->c_str()), &table_length); | 186 table, const_cast<char*>(result->c_str()), &table_length); |
189 } | 187 } |
190 | 188 |
191 } // namespace proxy | 189 } // namespace proxy |
192 } // namespace pp | 190 } // namespace ppapi |
OLD | NEW |