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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc

Issue 8840007: GetDocumentURL is added to PPB_Testing_Dev. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed codereview issues. Created 9 years 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 | « ppapi/c/dev/ppb_url_util_dev.h ('k') | ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc
index ceb8aaedb61b5a6945811747a639c2973d9a228c..69b04a088d3873f89c582622200742096b0ebfa9 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc
@@ -14,6 +14,7 @@
#include "ppapi/c/dev/ppb_testing_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_point.h"
+#include "ppapi/cpp/var.h"
#include "srpcgen/ppb_rpc.h"
using ppapi_proxy::DebugPrintf;
@@ -90,4 +91,27 @@ void PpbTestingRpcServer::PPB_Testing_GetLiveObjectsForInstance(
rpc->result = NACL_SRPC_RESULT_OK;
}
+void PpbTestingRpcServer::PPB_Testing_GetDocumentURL(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ nacl_abi_size_t* components_bytes, char* components,
+ nacl_abi_size_t* url_bytes, char* url) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+ if (*components_bytes != sizeof(struct PP_URLComponents_Dev))
+ return;
+ if (*url_bytes != ppapi_proxy::kMaxVarSize)
+ return;
+
+ struct PP_Var pp_url = PPBTestingInterface()->GetDocumentURL(
+ instance, reinterpret_cast<struct PP_URLComponents_Dev*>(components));
+
+ if (!ppapi_proxy::SerializeTo(&pp_url, url, url_bytes))
+ return;
+
+ DebugPrintf("PPB_Testing_Dev::GetDocumentURL: url=%s\n",
+ pp::Var(pp::Var::PassRef(), pp_url).AsString().c_str());
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
« no previous file with comments | « ppapi/c/dev/ppb_url_util_dev.h ('k') | ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698