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

Unified Diff: src/shared/ppapi_proxy/browser_ppp_printing.cc

Issue 7714041: Update proxy for PPP_Printing_Dev to deal with new QuerySupportedFormats (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fixes based on review Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/plugin_ppp_printing_rpc_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/ppapi_proxy/browser_ppp_printing.cc
diff --git a/src/shared/ppapi_proxy/browser_ppp_printing.cc b/src/shared/ppapi_proxy/browser_ppp_printing.cc
index 799d24fabc13afb25d72f818d456f4b37eb8b39d..7012e8cd97c6181a0b0f905ce69cc1670715c01a 100644
--- a/src/shared/ppapi_proxy/browser_ppp_printing.cc
+++ b/src/shared/ppapi_proxy/browser_ppp_printing.cc
@@ -4,53 +4,38 @@
#include "native_client/src/shared/ppapi_proxy/browser_ppp_printing.h"
-// Include file order cannot be observed because ppp_instance declares a
-// structure return type that causes an error on Windows.
-// TODO(sehr, brettw): fix the return types and include order in PPAPI.
-#include "native_client/src/third_party/ppapi/c/pp_instance.h"
-#include "native_client/src/third_party/ppapi/c/pp_resource.h"
-#include "srpcgen/ppp_rpc.h"
#include "native_client/src/include/portability.h"
#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
#include "native_client/src/shared/ppapi_proxy/browser_ppp.h"
+#include "native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppp_rpc.h"
#include "native_client/src/shared/ppapi_proxy/utility.h"
+#include "native_client/src/third_party/ppapi/c/pp_instance.h"
+#include "native_client/src/third_party/ppapi/c/pp_resource.h"
namespace ppapi_proxy {
namespace {
-const nacl_abi_size_t kPPPrintOutputFormatBytes =
- static_cast<nacl_abi_size_t>(sizeof(PP_PrintOutputFormat_Dev));
const nacl_abi_size_t kPPPrintSettingsBytes =
static_cast<nacl_abi_size_t>(sizeof(struct PP_PrintSettings_Dev));
const nacl_abi_size_t kPPPrintPageNumberRangeBytes =
static_cast<nacl_abi_size_t>(sizeof(struct PP_PrintPageNumberRange_Dev));
-PP_PrintOutputFormat_Dev* QuerySupportedFormats(PP_Instance instance,
- uint32_t* format_count) {
+uint32_t QuerySupportedFormats(PP_Instance instance) {
DebugPrintf("PPP_Printing_Dev::QuerySupportedFormats: "
"instance=%"NACL_PRIu32"\n", instance);
- const PPB_Memory_Dev* ppb_memory = PPBMemoryInterface();
- const nacl_abi_size_t kMaxFormats = 8;
- nacl_abi_size_t formats_bytes = kMaxFormats * kPPPrintOutputFormatBytes;
- char* formats =
- reinterpret_cast<char*>(ppb_memory->MemAlloc(formats_bytes));
+ uint32_t formats = 0;
NaClSrpcError srpc_result =
PppPrintingRpcClient::PPP_Printing_QuerySupportedFormats(
GetMainSrpcChannel(instance),
instance,
- &formats_bytes, formats,
- reinterpret_cast<int32_t*>(format_count));
+ reinterpret_cast<int32_t*>(formats));
DebugPrintf("PPP_Printing_Dev::QuerySupportedFormats: %s\n",
NaClSrpcErrorString(srpc_result));
- if (*format_count > 0)
- return reinterpret_cast<PP_PrintOutputFormat_Dev*>(formats);
-
- ppb_memory->MemFree(formats);
- return NULL;
+ return formats;
}
int32_t Begin(PP_Instance instance,
« no previous file with comments | « no previous file | src/shared/ppapi_proxy/plugin_ppp_printing_rpc_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698