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

Unified Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 7874002: This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/ppb_flash_proxy.h ('k') | ppapi/proxy/ppb_flash_tcp_socket_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_proxy.cc
===================================================================
--- ppapi/proxy/ppb_flash_proxy.cc (revision 100758)
+++ ppapi/proxy/ppb_flash_proxy.cc (working copy)
@@ -20,6 +20,7 @@
#include "ppapi/proxy/serialized_var.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/scoped_pp_resource.h"
+#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_url_request_info_api.h"
#include "ppapi/thunk/resource_creation_api.h"
@@ -152,12 +153,8 @@
}
PP_Var GetCommandLineArgs(PP_Module pp_module) {
- const PPB_Var_Deprecated* var_deprecated =
- static_cast<const PPB_Var_Deprecated*>(
- PluginDispatcher::GetInterfaceFromDispatcher(
- PPB_VAR_DEPRECATED_INTERFACE));
std::string args = ProxyModule::GetInstance()->GetFlashCommandLineArgs();
- return var_deprecated->VarFromUtf8(pp_module, args.data(), args.length());
+ return StringVar::StringToPPVar(pp_module, args);
}
const PPB_Flash flash_interface = {
@@ -171,16 +168,18 @@
&GetCommandLineArgs
};
-InterfaceProxy* CreateFlashProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPB_Flash_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreateFlashProxy(Dispatcher* dispatcher) {
+ return new PPB_Flash_Proxy(dispatcher);
}
} // namespace
-PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher,
- const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppb_flash_impl_(NULL) {
+ if (!dispatcher->IsPlugin())
+ ppb_flash_impl_ = static_cast<const PPB_Flash*>(
+ dispatcher->local_get_interface()(PPB_FLASH_INTERFACE));
}
PPB_Flash_Proxy::~PPB_Flash_Proxy() {
@@ -228,7 +227,7 @@
void PPB_Flash_Proxy::OnMsgSetInstanceAlwaysOnTop(
PP_Instance instance,
PP_Bool on_top) {
- ppb_flash_target()->SetInstanceAlwaysOnTop(instance, on_top);
+ ppb_flash_impl_->SetInstanceAlwaysOnTop(instance, on_top);
}
void PPB_Flash_Proxy::OnMsgDrawGlyphs(const PPBFlash_DrawGlyphs_Params& params,
@@ -242,7 +241,7 @@
params.glyph_indices.empty())
return;
- *result = ppb_flash_target()->DrawGlyphs(
+ *result = ppb_flash_impl_->DrawGlyphs(
0, // Unused instance param.
params.image_data.host_resource(), &font_desc,
params.color, params.position, params.clip,
@@ -255,7 +254,7 @@
void PPB_Flash_Proxy::OnMsgGetProxyForURL(PP_Instance instance,
const std::string& url,
SerializedVarReturnValue result) {
- result.Return(dispatcher(), ppb_flash_target()->GetProxyForURL(
+ result.Return(dispatcher(), ppb_flash_impl_->GetProxyForURL(
instance, url.c_str()));
}
@@ -292,23 +291,23 @@
ScopedPPResource::PassRef(),
enter.functions()->CreateURLRequestInfo(instance, data));
- *result = ppb_flash_target()->Navigate(request_resource,
- target.c_str(),
- from_user_action);
+ *result = ppb_flash_impl_->Navigate(request_resource,
+ target.c_str(),
+ from_user_action);
}
void PPB_Flash_Proxy::OnMsgRunMessageLoop(PP_Instance instance) {
- ppb_flash_target()->RunMessageLoop(instance);
+ ppb_flash_impl_->RunMessageLoop(instance);
}
void PPB_Flash_Proxy::OnMsgQuitMessageLoop(PP_Instance instance) {
- ppb_flash_target()->QuitMessageLoop(instance);
+ ppb_flash_impl_->QuitMessageLoop(instance);
}
void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance,
PP_Time t,
double* result) {
- *result = ppb_flash_target()->GetLocalTimeZoneOffset(instance, t);
+ *result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t);
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/ppb_flash_proxy.h ('k') | ppapi/proxy/ppb_flash_tcp_socket_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698