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

Side by Side Diff: ppapi/proxy/ppb_pdf_proxy.cc

Issue 11365235: Add PPAPI permissions for file chooser, PDF, testing, video capture, and video decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 "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
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 &pdf_interface, 148 &pdf_interface,
149 PPB_PDF_INTERFACE, 149 PPB_PDF_INTERFACE,
150 API_ID_PPB_PDF, 150 API_ID_PPB_PDF,
151 true, 151 true,
152 &CreatePDFProxy, 152 &CreatePDFProxy,
153 }; 153 };
154 return &info; 154 return &info;
155 } 155 }
156 156
157 bool PPB_PDF_Proxy::OnMessageReceived(const IPC::Message& msg) { 157 bool PPB_PDF_Proxy::OnMessageReceived(const IPC::Message& msg) {
158 // This is a private interface, plugin must have permission.
159 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE))
160 return false;
161
158 bool handled = true; 162 bool handled = true;
159 IPC_BEGIN_MESSAGE_MAP(PPB_PDF_Proxy, msg) 163 IPC_BEGIN_MESSAGE_MAP(PPB_PDF_Proxy, msg)
160 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontFileWithFallback, 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontFileWithFallback,
161 OnMsgGetFontFileWithFallback) 165 OnMsgGetFontFileWithFallback)
162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile, 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile,
163 OnMsgGetFontTableForPrivateFontFile) 167 OnMsgGetFontTableForPrivateFontFile)
164 IPC_MESSAGE_UNHANDLED(handled = false) 168 IPC_MESSAGE_UNHANDLED(handled = false)
165 IPC_END_MESSAGE_MAP() 169 IPC_END_MESSAGE_MAP()
166 // TODO(brettw): handle bad messages! 170 // TODO(brettw): handle bad messages!
167 return handled; 171 return handled;
(...skipping 25 matching lines...) Expand all
193 font_file.host_resource(), table, NULL, &table_length)) 197 font_file.host_resource(), table, NULL, &table_length))
194 return; 198 return;
195 199
196 result->resize(table_length); 200 result->resize(table_length);
197 ppb_pdf_impl_->GetFontTableForPrivateFontFile(font_file.host_resource(), 201 ppb_pdf_impl_->GetFontTableForPrivateFontFile(font_file.host_resource(),
198 table, const_cast<char*>(result->c_str()), &table_length); 202 table, const_cast<char*>(result->c_str()), &table_length);
199 } 203 }
200 204
201 } // namespace proxy 205 } // namespace proxy
202 } // namespace ppapi 206 } // namespace ppapi
OLDNEW
« no previous file with comments | « content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | ppapi/proxy/ppb_testing_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698