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

Unified Diff: ppapi/proxy/extensions_common_resource.cc

Issue 15039008: Add browser resource host for Apps v2 APIs in Pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 | « ppapi/proxy/extensions_common_resource.h ('k') | ppapi/thunk/extensions_common_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/extensions_common_resource.cc
diff --git a/ppapi/proxy/extensions_common_resource.cc b/ppapi/proxy/extensions_common_resource.cc
index ab030ef10cb137adc0c60bc71e441de4aa16a132..0393b12b6a32ad2541b233e2166059395e0766fe 100644
--- a/ppapi/proxy/extensions_common_resource.cc
+++ b/ppapi/proxy/extensions_common_resource.cc
@@ -22,6 +22,7 @@ ExtensionsCommonResource::ExtensionsCommonResource(Connection connection,
PP_Instance instance)
: PluginResource(connection, instance) {
SendCreate(RENDERER, PpapiHostMsg_ExtensionsCommon_Create());
+ SendCreate(BROWSER, PpapiHostMsg_ExtensionsCommon_Create());
}
ExtensionsCommonResource::~ExtensionsCommonResource() {
@@ -32,7 +33,34 @@ ExtensionsCommonResource::AsExtensionsCommon_API() {
return this;
}
-int32_t ExtensionsCommonResource::Call(
+int32_t ExtensionsCommonResource::CallRenderer(
+ const std::string& request_name,
+ const std::vector<PP_Var>& input_args,
+ const std::vector<PP_Var*>& output_args,
+ scoped_refptr<TrackedCallback> callback) {
+ return CommonCall(RENDERER, request_name, input_args, output_args, callback);
+}
+
+void ExtensionsCommonResource::PostRenderer(const std::string& request_name,
+ const std::vector<PP_Var>& args) {
+ CommonPost(RENDERER, request_name, args);
+}
+
+int32_t ExtensionsCommonResource::CallBrowser(
+ const std::string& request_name,
+ const std::vector<PP_Var>& input_args,
+ const std::vector<PP_Var*>& output_args,
+ scoped_refptr<TrackedCallback> callback) {
+ return CommonCall(BROWSER, request_name, input_args, output_args, callback);
+}
+
+void ExtensionsCommonResource::PostBrowser(const std::string& request_name,
+ const std::vector<PP_Var>& args) {
+ CommonPost(BROWSER, request_name, args);
+}
+
+int32_t ExtensionsCommonResource::CommonCall(
+ Destination dest,
const std::string& request_name,
const std::vector<PP_Var>& input_args,
const std::vector<PP_Var*>& output_args,
@@ -50,15 +78,16 @@ int32_t ExtensionsCommonResource::Call(
}
PluginResource::Call<PpapiPluginMsg_ExtensionsCommon_CallReply>(
- RENDERER,
+ dest,
PpapiHostMsg_ExtensionsCommon_Call(request_name, *input_args_value),
base::Bind(&ExtensionsCommonResource::OnPluginMsgCallReply,
base::Unretained(this), output_args, callback));
return PP_OK_COMPLETIONPENDING;
}
-void ExtensionsCommonResource::Post(const std::string& request_name,
- const std::vector<PP_Var>& args) {
+void ExtensionsCommonResource::CommonPost(Destination dest,
+ const std::string& request_name,
+ const std::vector<PP_Var>& args) {
scoped_ptr<base::ListValue> args_value(CreateListValueFromVarVector(args));
if (!args_value.get()) {
LOG(WARNING) << "Failed to convert PP_Var input arguments.";
@@ -66,7 +95,7 @@ void ExtensionsCommonResource::Post(const std::string& request_name,
}
PluginResource::Post(
- RENDERER, PpapiHostMsg_ExtensionsCommon_Post(request_name, *args_value));
+ dest, PpapiHostMsg_ExtensionsCommon_Post(request_name, *args_value));
}
void ExtensionsCommonResource::OnPluginMsgCallReply(
« no previous file with comments | « ppapi/proxy/extensions_common_resource.h ('k') | ppapi/thunk/extensions_common_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698