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

Unified Diff: ppapi/proxy/ppb_flash_clipboard_proxy.cc

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch 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_clipboard_proxy.h ('k') | ppapi/proxy/ppb_flash_file_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_clipboard_proxy.cc
diff --git a/ppapi/proxy/ppb_flash_clipboard_proxy.cc b/ppapi/proxy/ppb_flash_clipboard_proxy.cc
index 38e3e5bff365acce7118ad46d3df4bd0220058e2..18918fc1038a07a667b2f0fc347d61132cc9b56e 100644
--- a/ppapi/proxy/ppb_flash_clipboard_proxy.cc
+++ b/ppapi/proxy/ppb_flash_clipboard_proxy.cc
@@ -88,16 +88,19 @@ const PPB_Flash_Clipboard flash_clipboard_interface = {
&WritePlainText
};
-InterfaceProxy* CreateFlashClipboardProxy(Dispatcher* dispatcher,
- const void* target_interface) {
- return new PPB_Flash_Clipboard_Proxy(dispatcher, target_interface);
+InterfaceProxy* CreateFlashClipboardProxy(Dispatcher* dispatcher) {
+ return new PPB_Flash_Clipboard_Proxy(dispatcher);
}
} // namespace
-PPB_Flash_Clipboard_Proxy::PPB_Flash_Clipboard_Proxy(
- Dispatcher* dispatcher, const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+PPB_Flash_Clipboard_Proxy::PPB_Flash_Clipboard_Proxy(Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher),
+ ppb_flash_clipboard_impl_(NULL) {
+ if (!dispatcher->IsPlugin()) {
+ ppb_flash_clipboard_impl_ = static_cast<const PPB_Flash_Clipboard*>(
+ dispatcher->local_get_interface()(PPB_FLASH_CLIPBOARD_INTERFACE));
+ }
}
PPB_Flash_Clipboard_Proxy::~PPB_Flash_Clipboard_Proxy() {
@@ -134,7 +137,7 @@ void PPB_Flash_Clipboard_Proxy::OnMsgIsFormatAvailable(
int clipboard_type,
int format,
bool* result) {
- *result = PP_ToBool(ppb_flash_clipboard_target()->IsFormatAvailable(
+ *result = PP_ToBool(ppb_flash_clipboard_impl_->IsFormatAvailable(
instance_id,
static_cast<PP_Flash_Clipboard_Type>(clipboard_type),
static_cast<PP_Flash_Clipboard_Format>(format)));
@@ -145,7 +148,7 @@ void PPB_Flash_Clipboard_Proxy::OnMsgReadPlainText(
int clipboard_type,
SerializedVarReturnValue result) {
result.Return(dispatcher(),
- ppb_flash_clipboard_target()->ReadPlainText(
+ ppb_flash_clipboard_impl_->ReadPlainText(
instance_id,
static_cast<PP_Flash_Clipboard_Type>(clipboard_type)));
}
@@ -154,7 +157,7 @@ void PPB_Flash_Clipboard_Proxy::OnMsgWritePlainText(
PP_Instance instance_id,
int clipboard_type,
SerializedVarReceiveInput text) {
- int32_t result = ppb_flash_clipboard_target()->WritePlainText(
+ int32_t result = ppb_flash_clipboard_impl_->WritePlainText(
instance_id,
static_cast<PP_Flash_Clipboard_Type>(clipboard_type),
text.Get(dispatcher()));
« no previous file with comments | « ppapi/proxy/ppb_flash_clipboard_proxy.h ('k') | ppapi/proxy/ppb_flash_file_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698