diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 01:50:31 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 01:50:31 +0000 |
commit | 9ca245e3b2d0e2271c7124d3aceb8179903718e2 (patch) | |
tree | aa5fdbad23bd9a91cb117c1610064242d8a00985 /ppapi/proxy/ppb_url_util_proxy.h | |
parent | a2f013ebcd62eae5238ca4ee84b9d21e34197fd8 (diff) | |
download | chromium_src-9ca245e3b2d0e2271c7124d3aceb8179903718e2.zip chromium_src-9ca245e3b2d0e2271c7124d3aceb8179903718e2.tar.gz chromium_src-9ca245e3b2d0e2271c7124d3aceb8179903718e2.tar.bz2 |
Implement a proxy for URL util. Some of the implementation that doesn't need to
be proxied moved into a new shared_impl file, which required a decent amount of
glue to make it callable from both the implementation and the proxy. The payoff
here is only marginal since the code is fairly simple, but I decided this is
still better than duplication.
This also includes some comments from my audio patch that I forgot in that CL.
BUG=none
TEST=ppapi_tests run out of process pass
Review URL: http://codereview.chromium.org/6676045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_url_util_proxy.h')
-rw-r--r-- | ppapi/proxy/ppb_url_util_proxy.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_url_util_proxy.h b/ppapi/proxy/ppb_url_util_proxy.h new file mode 100644 index 0000000..2d4e001 --- /dev/null +++ b/ppapi/proxy/ppb_url_util_proxy.h @@ -0,0 +1,52 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ +#define PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ + +#include "ppapi/c/pp_instance.h" +#include "ppapi/proxy/interface_proxy.h" +#include "ppapi/proxy/serialized_var.h" + +struct PPB_URLUtil_Dev; + +namespace pp { +namespace proxy { + +class PPB_URLUtil_Proxy : public InterfaceProxy { + public: + PPB_URLUtil_Proxy(Dispatcher* dispatcher, const void* target_interface); + virtual ~PPB_URLUtil_Proxy(); + + static const Info* GetInfo(); + + const PPB_URLUtil_Dev* ppb_url_util_target() const { + return static_cast<const PPB_URLUtil_Dev*>(target_interface()); + } + + // InterfaceProxy implementation. + virtual bool OnMessageReceived(const IPC::Message& msg); + + private: + // Message handlers. + void OnMsgResolveRelativeToDocument(PP_Instance instance, + SerializedVarReceiveInput relative, + SerializedVarReturnValue result); + void OnMsgDocumentCanRequest(PP_Instance instance, + SerializedVarReceiveInput url, + PP_Bool* result); + void OnMsgDocumentCanAccessDocument(PP_Instance active, + PP_Instance target, + PP_Bool* result); + void OnMsgGetDocumentURL(PP_Instance instance, + SerializedVarReturnValue result); + + DISALLOW_COPY_AND_ASSIGN(PPB_URLUtil_Proxy); +}; + +} // namespace proxy +} // namespace pp + +#endif // PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ + |