Move host resource from the proxy to the shared_impl.

This is needed by my new unified resoruce tracker, which will use this file from the shared_impl in the new resource base object.

I fixed up the namespaces for the callers. Longer term, I want to put the
proxy in the ppapi namespace which will eliminate some of this mess.

Review URL: http://codereview.chromium.org/7623018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96678 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index 07ceae2..774132a 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -33,7 +33,6 @@
         'proxy/dispatcher.h',
         'proxy/host_dispatcher.cc',
         'proxy/host_dispatcher.h',
-        'proxy/host_resource.h',
         'proxy/host_var_serialization_rules.cc',
         'proxy/host_var_serialization_rules.h',
         'proxy/interface_proxy.cc',
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index 6f3caf5..8e782fc 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -38,6 +38,7 @@
         'shared_impl/function_group_base.h',
         'shared_impl/graphics_3d_impl.cc',
         'shared_impl/graphics_3d_impl.h',
+        'shared_impl/host_resource.h',
         'shared_impl/id_assignment.cc',
         'shared_impl/id_assignment.h',
         'shared_impl/image_data_impl.cc',
diff --git a/ppapi/proxy/enter_proxy.h b/ppapi/proxy/enter_proxy.h
index c3b7338..d710c6c 100644
--- a/ppapi/proxy/enter_proxy.h
+++ b/ppapi/proxy/enter_proxy.h
@@ -25,7 +25,7 @@
 class EnterPluginFromHostResource
     : public ::ppapi::thunk::EnterResourceNoLock<ResourceT> {
  public:
-  EnterPluginFromHostResource(const HostResource& host_resource)
+  EnterPluginFromHostResource(const ppapi::HostResource& host_resource)
       : ::ppapi::thunk::EnterResourceNoLock<ResourceT>(
             PluginResourceTracker::GetInstance()->PluginResourceForHostResource(
                 host_resource),
@@ -42,7 +42,7 @@
 class EnterHostFromHostResource
     : public ::ppapi::thunk::EnterResourceNoLock<ResourceT> {
  public:
-  EnterHostFromHostResource(const HostResource& host_resource)
+  EnterHostFromHostResource(const ppapi::HostResource& host_resource)
       : ::ppapi::thunk::EnterResourceNoLock<ResourceT>(
             host_resource.host_resource(), false) {
     // Validate that we're in the host rather than the plugin. Otherwise this
@@ -90,9 +90,10 @@
   // For callbacks that take no parameters except the "int32_t result". Most
   // implementations will use the 1-extra-argument constructor below.
   template<class CallbackFactory, typename Method>
-  EnterHostFromHostResourceForceCallback(const HostResource& host_resource,
-                                         CallbackFactory& factory,
-                                         Method method)
+  EnterHostFromHostResourceForceCallback(
+      const ppapi::HostResource& host_resource,
+      CallbackFactory& factory,
+      Method method)
       : EnterHostFromHostResource<ResourceT>(host_resource),
         needs_running_(true),
         callback_(factory.NewOptionalCallback(method)) {
@@ -102,10 +103,11 @@
 
   // For callbacks that take an extra parameter as a closure.
   template<class CallbackFactory, typename Method, typename A>
-  EnterHostFromHostResourceForceCallback(const HostResource& host_resource,
-                                         CallbackFactory& factory,
-                                         Method method,
-                                         const A& a)
+  EnterHostFromHostResourceForceCallback(
+      const ppapi::HostResource& host_resource,
+      CallbackFactory& factory,
+      Method method,
+      const A& a)
       : EnterHostFromHostResource<ResourceT>(host_resource),
         needs_running_(true),
         callback_(factory.NewOptionalCallback(method, a)) {
diff --git a/ppapi/proxy/host_dispatcher_unittest.cc b/ppapi/proxy/host_dispatcher_unittest.cc
index b2caa1a..14dfed5 100644
--- a/ppapi/proxy/host_dispatcher_unittest.cc
+++ b/ppapi/proxy/host_dispatcher_unittest.cc
@@ -9,6 +9,8 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppapi_proxy_test.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/mock_resource.cc b/ppapi/proxy/mock_resource.cc
index dc7bc8a..2f1a0b7 100644
--- a/ppapi/proxy/mock_resource.cc
+++ b/ppapi/proxy/mock_resource.cc
@@ -4,6 +4,8 @@
 
 #include "ppapi/proxy/mock_resource.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/mock_resource.h b/ppapi/proxy/mock_resource.h
index 103aacc..dbad2f6 100644
--- a/ppapi/proxy/mock_resource.h
+++ b/ppapi/proxy/mock_resource.h
@@ -13,7 +13,7 @@
 
 class MockResource : public PluginResource {
  public:
-  MockResource(const HostResource& resource);
+  MockResource(const ppapi::HostResource& resource);
   virtual ~MockResource();
 
  private:
diff --git a/ppapi/proxy/plugin_dispatcher_unittest.cc b/ppapi/proxy/plugin_dispatcher_unittest.cc
index f3e8da5e..d68fc58c 100644
--- a/ppapi/proxy/plugin_dispatcher_unittest.cc
+++ b/ppapi/proxy/plugin_dispatcher_unittest.cc
@@ -9,6 +9,8 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppapi_proxy_test.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index 67a47f44..e9f3b75 100644
--- a/ppapi/proxy/plugin_resource.cc
+++ b/ppapi/proxy/plugin_resource.cc
@@ -4,6 +4,8 @@
 
 #include "ppapi/proxy/plugin_resource.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/plugin_resource.h b/ppapi/proxy/plugin_resource.h
index 10dbf72..298b4cd 100644
--- a/ppapi/proxy/plugin_resource.h
+++ b/ppapi/proxy/plugin_resource.h
@@ -7,9 +7,9 @@
 
 #include "base/basictypes.h"
 #include "ppapi/c/pp_instance.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/plugin_dispatcher.h"
 #include "ppapi/proxy/plugin_resource_tracker.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/resource_object_base.h"
 
 namespace pp {
@@ -17,13 +17,13 @@
 
 class PluginResource : public ::ppapi::ResourceObjectBase {
  public:
-  PluginResource(const HostResource& resource);
+  PluginResource(const ppapi::HostResource& resource);
   virtual ~PluginResource();
 
   PP_Instance instance() const { return host_resource_.instance(); }
 
   // Returns the host resource ID for sending to the host process.
-  const HostResource& host_resource() const {
+  const ppapi::HostResource& host_resource() const {
     return host_resource_;
   }
 
@@ -34,7 +34,7 @@
   // plugin we'll remap the resource IDs so we can have many host processes
   // each independently generating resources (which may conflict) but the IDs
   // in the plugin will all be unique.
-  HostResource host_resource_;
+  ppapi::HostResource host_resource_;
 
   DISALLOW_COPY_AND_ASSIGN(PluginResource);
 };
diff --git a/ppapi/proxy/plugin_resource_tracker.cc b/ppapi/proxy/plugin_resource_tracker.cc
index a82ccef..a511fd9 100644
--- a/ppapi/proxy/plugin_resource_tracker.cc
+++ b/ppapi/proxy/plugin_resource_tracker.cc
@@ -13,6 +13,8 @@
 #include "ppapi/shared_impl/tracker_base.h"
 #include "ppapi/shared_impl/var.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/plugin_resource_tracker.h b/ppapi/proxy/plugin_resource_tracker.h
index d313a9f..f788c6c 100644
--- a/ppapi/proxy/plugin_resource_tracker.h
+++ b/ppapi/proxy/plugin_resource_tracker.h
@@ -14,8 +14,8 @@
 #include "ppapi/c/pp_stdint.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/pp_var.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/plugin_var_tracker.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/tracker_base.h"
 
 template<typename T> struct DefaultSingletonTraits;
@@ -59,7 +59,7 @@
   // Given a host resource, maps it to an existing plugin resource ID if it
   // exists, or returns 0 on failure.
   PP_Resource PluginResourceForHostResource(
-      const HostResource& resource) const;
+      const ppapi::HostResource& resource) const;
 
   PluginVarTracker& var_tracker() {
     return var_tracker_test_override_ ? *var_tracker_test_override_
@@ -118,7 +118,7 @@
   ResourceMap resource_map_;
 
   // Map of host instance/resource pairs to a plugin resource ID.
-  typedef std::map<HostResource, PP_Resource> HostResourceMap;
+  typedef std::map<ppapi::HostResource, PP_Resource> HostResourceMap;
   HostResourceMap host_resource_map_;
 
   // Tracks the last ID we've sent out as a plugin resource so we don't send
diff --git a/ppapi/proxy/plugin_resource_tracker_unittest.cc b/ppapi/proxy/plugin_resource_tracker_unittest.cc
index 5d673f52..8295302d 100644
--- a/ppapi/proxy/plugin_resource_tracker_unittest.cc
+++ b/ppapi/proxy/plugin_resource_tracker_unittest.cc
@@ -10,6 +10,8 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppapi_proxy_test.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 0556304..5b7c6dd 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -171,7 +171,7 @@
 // The handler of this message should always close all of the handles passed
 // in, since some could be valid even in the error case.
 IPC_MESSAGE_ROUTED5(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
-                    pp::proxy::HostResource /* audio_id */,
+                    ppapi::HostResource /* audio_id */,
                     int32_t /* result_code (will be != PP_OK on failure) */,
                     IPC::PlatformFileForTransit /* socket_handle */,
                     base::SharedMemoryHandle /* handle */,
@@ -180,26 +180,26 @@
 // PPB_Broker.
 IPC_MESSAGE_ROUTED3(
     PpapiMsg_PPBBroker_ConnectComplete,
-    pp::proxy::HostResource /* broker */,
+    ppapi::HostResource /* broker */,
     IPC::PlatformFileForTransit /* handle */,
     int32_t /* result */)
 
 // PPB_FileChooser.
 IPC_MESSAGE_ROUTED3(
     PpapiMsg_PPBFileChooser_ChooseComplete,
-    pp::proxy::HostResource /* chooser */,
+    ppapi::HostResource /* chooser */,
     int32_t /* result_code (will be != PP_OK on failure */,
     std::vector<pp::proxy::PPBFileRef_CreateInfo> /* chosen_files */)
 
 // PPB_FileSystem.
 IPC_MESSAGE_ROUTED2(
     PpapiMsg_PPBFileSystem_OpenComplete,
-    pp::proxy::HostResource /* filesystem */,
+    ppapi::HostResource /* filesystem */,
     int32_t /* result */)
 
 // PPB_Flash_NetConnector.
 IPC_MESSAGE_ROUTED5(PpapiMsg_PPBFlashNetConnector_ConnectACK,
-                    pp::proxy::HostResource /* net_connector */,
+                    ppapi::HostResource /* net_connector */,
                     int32_t /* result */,
                     IPC::PlatformFileForTransit /* handle */,
                     std::string /* local_addr_as_string */,
@@ -225,17 +225,17 @@
 
 // PPB_Graphics2D.
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics2D_FlushACK,
-                    pp::proxy::HostResource /* graphics_2d */,
+                    ppapi::HostResource /* graphics_2d */,
                     int32_t /* pp_error */)
 
 // PPB_Graphics3D.
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics3D_SwapBuffersACK,
-                    pp::proxy::HostResource /* graphics_3d */,
+                    ppapi::HostResource /* graphics_3d */,
                     int32_t /* pp_error */)
 
 // PPB_Surface3D.
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPBSurface3D_SwapBuffersACK,
-                    pp::proxy::HostResource /* surface_3d */,
+                    ppapi::HostResource /* surface_3d */,
                     int32_t /* pp_error */)
 
 // PPP_Class.
@@ -321,7 +321,7 @@
                     PP_Bool /* has_focus */)
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleDocumentLoad,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* url_loader */,
+                           ppapi::HostResource /* url_loader */,
                            PP_Bool /* result */)
 
 // PPP_Instance_Private.
@@ -339,54 +339,54 @@
 IPC_MESSAGE_ROUTED1(PpapiMsg_PPBURLLoader_UpdateProgress,
                     pp::proxy::PPBURLLoader_UpdateProgress_Params /* params */)
 IPC_MESSAGE_ROUTED3(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack,
-                    pp::proxy::HostResource /* loader */,
+                    ppapi::HostResource /* loader */,
                     int32 /* result */,
                     std::string /* data */)
 
 // PPP_VideoCapture_Dev
 IPC_MESSAGE_ROUTED3(
     PpapiMsg_PPPVideoCapture_OnDeviceInfo,
-    pp::proxy::HostResource /* video_capture */,
+    ppapi::HostResource /* video_capture */,
     PP_VideoCaptureDeviceInfo_Dev /* info */,
     std::vector<pp::proxy::PPPVideoCapture_Buffer> /* buffers */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoCapture_OnStatus,
-                    pp::proxy::HostResource /* video_capture */,
+                    ppapi::HostResource /* video_capture */,
                     uint32_t /* status */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoCapture_OnError,
-                    pp::proxy::HostResource /* video_capture */,
+                    ppapi::HostResource /* video_capture */,
                     uint32_t /* error_code */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoCapture_OnBufferReady,
-                    pp::proxy::HostResource /* video_capture */,
+                    ppapi::HostResource /* video_capture */,
                     uint32_t /* buffer */)
 
 // PPB_VideoDecoder_Dev.
 // (Messages from renderer to plugin to notify it to run callbacks.)
 IPC_MESSAGE_ROUTED3(PpapiMsg_PPBVideoDecoder_EndOfBitstreamACK,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     int32_t /* bitstream buffer id */,
                     int32_t /* PP_CompletionCallback result */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPBVideoDecoder_FlushACK,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     int32_t /* PP_CompletionCallback result  */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPBVideoDecoder_ResetACK,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     int32_t /* PP_CompletionCallback result */)
 
 // PPP_VideoDecoder_Dev.
 IPC_MESSAGE_ROUTED3(PpapiMsg_PPPVideoDecoder_ProvidePictureBuffers,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     uint32_t /* requested number of buffers */,
                     PP_Size /* dimensions of buffers */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_DismissPictureBuffer,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     int32_t /* picture buffer id */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_PictureReady,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     PP_Picture_Dev /* output picture */)
 IPC_MESSAGE_ROUTED1(PpapiMsg_PPPVideoDecoder_NotifyEndOfStream,
-                    pp::proxy::HostResource /* video_decoder */)
+                    ppapi::HostResource /* video_decoder */)
 IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_NotifyError,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     PP_VideoDecodeError_Dev /* error */)
 
 // -----------------------------------------------------------------------------
@@ -404,23 +404,23 @@
                            PP_Instance /* instance_id */,
                            int32_t /* sample_rate */,
                            uint32_t /* sample_frame_count */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBAudio_StartOrStop,
-                    pp::proxy::HostResource /* audio_id */,
+                    ppapi::HostResource /* audio_id */,
                     bool /* play */)
 
 // PPB_Broker.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBBroker_Create,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* result_resource */)
+                           ppapi::HostResource /* result_resource */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBBroker_Connect,
-                    pp::proxy::HostResource /* broker */)
+                    ppapi::HostResource /* broker */)
 
 // PPB_Buffer.
 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBBuffer_Create,
                            PP_Instance /* instance */,
                            uint32_t /* size */,
-                           pp::proxy::HostResource /* result_resource */,
+                           ppapi::HostResource /* result_resource */,
                            base::SharedMemoryHandle /* result_shm_handle */)
 
 // PPB_Console.
@@ -439,53 +439,53 @@
                            PP_Instance /* instance */,
                            int32_t /* config */,
                            std::vector<int32_t> /* attrib_list */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBContext3D_BindSurfaces,
-                           pp::proxy::HostResource /* context */,
-                           pp::proxy::HostResource /* draw */,
-                           pp::proxy::HostResource /* read */,
+                           ppapi::HostResource /* context */,
+                           ppapi::HostResource /* draw */,
+                           ppapi::HostResource /* read */,
                            int32_t /* result */)
 
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBContext3D_Initialize,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* size */,
                            base::SharedMemoryHandle /* ring_buffer */)
 
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBContext3D_GetState,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            gpu::CommandBuffer::State /* state */)
 
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBContext3D_Flush,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* put_offset */,
                            int32 /* last_known_get */,
                            gpu::CommandBuffer::State /* state */)
 
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBContext3D_AsyncFlush,
-                    pp::proxy::HostResource /* context */,
+                    ppapi::HostResource /* context */,
                     int32 /* put_offset */)
 
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBContext3D_CreateTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* size */,
                            int32 /* id */)
 
 IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBContext3D_DestroyTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* id */)
 
 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBContext3D_GetTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* id */,
                            base::SharedMemoryHandle /* transfer_buffer */,
                            uint32 /* size */)
 
 // PPB_Core.
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_AddRefResource,
-                    pp::proxy::HostResource)
+                    ppapi::HostResource)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_ReleaseResource,
-                    pp::proxy::HostResource)
+                    ppapi::HostResource)
 
 // PPB_CharSet.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCharSet_GetDefaultCharSet,
@@ -496,7 +496,7 @@
 IPC_SYNC_MESSAGE_ROUTED4_1(PpapiHostMsg_PPBCursorControl_SetCursor,
                            PP_Instance /* instance */,
                            int32_t /* type */,
-                           pp::proxy::HostResource /* custom_image */,
+                           ppapi::HostResource /* custom_image */,
                            PP_Point /* hot_spot */,
                            PP_Bool /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_LockCursor,
@@ -517,43 +517,43 @@
                            PP_Instance /* instance */,
                            int /* mode */,
                            std::string /* accept_mime_types */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBFileChooser_Show,
-                    pp::proxy::HostResource /* file_chooser */)
+                    ppapi::HostResource /* file_chooser */)
 
 
 // PPB_FileRef.
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFileRef_Create,
-                           pp::proxy::HostResource /* file_system */,
+                           ppapi::HostResource /* file_system */,
                            std::string /* path */,
                            pp::proxy::PPBFileRef_CreateInfo /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFileRef_GetParent,
-                           pp::proxy::HostResource /* file_ref */,
+                           ppapi::HostResource /* file_ref */,
                            pp::proxy::PPBFileRef_CreateInfo /* result */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBFileRef_MakeDirectory,
-                    pp::proxy::HostResource /* file_ref */,
+                    ppapi::HostResource /* file_ref */,
                     PP_Bool /* make_ancestors */,
                     uint32_t /* serialized_callback */)
 IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBFileRef_Touch,
-                    pp::proxy::HostResource /* file_ref */,
+                    ppapi::HostResource /* file_ref */,
                     PP_Time /* last_access */,
                     PP_Time /* last_modified */,
                     uint32_t /* serialized_callback */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFileRef_Delete,
-                    pp::proxy::HostResource /* file_ref */,
+                    ppapi::HostResource /* file_ref */,
                     uint32_t /* serialized_callback */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBFileRef_Rename,
-                    pp::proxy::HostResource /* file_ref */,
-                    pp::proxy::HostResource /* new_file_ref */,
+                    ppapi::HostResource /* file_ref */,
+                    ppapi::HostResource /* new_file_ref */,
                     uint32_t /* serialized_callback */)
 
 // PPB_FileSystem.
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFileSystem_Create,
                            PP_Instance /* instance */,
                            int /* type */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFileSystem_Open,
-                    pp::proxy::HostResource /* result */,
+                    ppapi::HostResource /* result */,
                     int64_t /* expected_size */)
 
 // PPB_Flash.
@@ -570,7 +570,7 @@
                            std::string /* url */,
                            pp::proxy::SerializedVar /* result */)
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_Navigate,
-                           pp::proxy::HostResource /* request_info */,
+                           ppapi::HostResource /* request_info */,
                            std::string /* target */,
                            bool /* from_user_action */,
                            int32_t /* result */)
@@ -600,12 +600,12 @@
 
 // PPB_Flash_File_FileRef.
 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBFlashFile_FileRef_OpenFile,
-                           pp::proxy::HostResource /* file_ref */,
+                           ppapi::HostResource /* file_ref */,
                            int32_t /* mode */,
                            IPC::PlatformFileForTransit /* file_handle */,
                            int32_t /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBFlashFile_FileRef_QueryFile,
-                           pp::proxy::HostResource /* file_ref */,
+                           ppapi::HostResource /* file_ref */,
                            PP_FileInfo /* info */,
                            int32_t /* result */)
 
@@ -647,25 +647,25 @@
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlashMenu_Create,
                            PP_Instance /* instance */,
                            pp::proxy::SerializedFlashMenu /* menu_data */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBFlashMenu_Show,
-                           pp::proxy::HostResource /* menu */,
+                           ppapi::HostResource /* menu */,
                            PP_Point /* location */)
 IPC_MESSAGE_ROUTED3(PpapiMsg_PPBFlashMenu_ShowACK,
-                    pp::proxy::HostResource /* menu */,
+                    ppapi::HostResource /* menu */,
                     int32_t /* selected_id */,
                     int32_t /* result */)
 
 // PPB_Flash_NetConnector.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlashNetConnector_Create,
                            PP_Instance /* instance_id */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBFlashNetConnector_ConnectTcp,
-                    pp::proxy::HostResource /* connector */,
+                    ppapi::HostResource /* connector */,
                     std::string /* host */,
                     uint16_t /* port */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress,
-                    pp::proxy::HostResource /* connector */,
+                    ppapi::HostResource /* connector */,
                     std::string /* net_address_as_string */)
 
 // PPB_Flash_TCPSocket.
@@ -695,65 +695,65 @@
 
 // PPB_Graphics2D.
 IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBGraphics2D_PaintImageData,
-                    pp::proxy::HostResource /* graphics_2d */,
-                    pp::proxy::HostResource /* image_data */,
+                    ppapi::HostResource /* graphics_2d */,
+                    ppapi::HostResource /* image_data */,
                     PP_Point /* top_left */,
                     bool /* src_rect_specified */,
                     PP_Rect /* src_rect */)
 IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBGraphics2D_Scroll,
-                    pp::proxy::HostResource /* graphics_2d */,
+                    ppapi::HostResource /* graphics_2d */,
                     bool /* clip_specified */,
                     PP_Rect /* clip */,
                     PP_Point /* amount */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBGraphics2D_ReplaceContents,
-                    pp::proxy::HostResource /* graphics_2d */,
-                    pp::proxy::HostResource /* image_data */)
+                    ppapi::HostResource /* graphics_2d */,
+                    ppapi::HostResource /* image_data */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics2D_Flush,
-                    pp::proxy::HostResource /* graphics_2d */)
+                    ppapi::HostResource /* graphics_2d */)
 
 // PPB_Graphics3D.
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics3D_Create,
                            PP_Instance /* instance */,
                            int32_t /* config */,
                            std::vector<int32_t> /* attrib_list */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_InitCommandBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* size */,
                            base::SharedMemoryHandle /* ring_buffer */)
 
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBGraphics3D_GetState,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            gpu::CommandBuffer::State /* state */)
 
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics3D_Flush,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* put_offset */,
                            int32 /* last_known_get */,
                            gpu::CommandBuffer::State /* state */)
 
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBGraphics3D_AsyncFlush,
-                    pp::proxy::HostResource /* context */,
+                    ppapi::HostResource /* context */,
                     int32 /* put_offset */)
 
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* size */,
                            int32 /* id */)
 
 IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBGraphics3D_DestroyTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* id */)
 
 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            int32 /* id */,
                            base::SharedMemoryHandle /* transfer_buffer */,
                            uint32 /* size */)
 
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics3D_SwapBuffers,
-                    pp::proxy::HostResource /* graphics_3d */)
+                    ppapi::HostResource /* graphics_3d */)
 
 // PPB_Instance.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetWindowObject,
@@ -764,7 +764,7 @@
                            pp::proxy::SerializedVar /* result */)
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_BindGraphics,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* device */,
+                           ppapi::HostResource /* device */,
                            PP_Bool /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_IsFullFrame,
                            PP_Instance /* instance */,
@@ -798,10 +798,10 @@
     PP_Instance /* instance */,
     pp::proxy::SerializedFontDescription /* description */,
     int32_t /* charset */,
-    pp::proxy::HostResource /* result */)
+    ppapi::HostResource /* result */)
 IPC_SYNC_MESSAGE_ROUTED2_1(
     PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile,
-    pp::proxy::HostResource /* font_file */,
+    ppapi::HostResource /* font_file */,
     uint32_t /* table */,
     std::string /* result */)
 
@@ -810,15 +810,15 @@
                            PP_Instance /* instance */,
                            int32_t /* config */,
                            std::vector<int32_t> /* attrib_list */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBSurface3D_SwapBuffers,
-                    pp::proxy::HostResource /* surface_3d */)
+                    ppapi::HostResource /* surface_3d */)
 
 // PPB_Testing.
 IPC_SYNC_MESSAGE_ROUTED3_1(
     PpapiHostMsg_PPBTesting_ReadImageData,
-    pp::proxy::HostResource /* device_context_2d */,
-    pp::proxy::HostResource /* image */,
+    ppapi::HostResource /* device_context_2d */,
+    ppapi::HostResource /* image */,
     PP_Point /* top_left */,
     PP_Bool /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance,
@@ -828,54 +828,54 @@
 // PPB_URLLoader.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLLoader_Create,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLLoader_Open,
-                    pp::proxy::HostResource /* loader */,
-                    pp::proxy::HostResource /*request_info */,
+                    ppapi::HostResource /* loader */,
+                    ppapi::HostResource /*request_info */,
                     uint32_t /* serialized_callback */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FollowRedirect,
-                    pp::proxy::HostResource /* loader */,
+                    ppapi::HostResource /* loader */,
                     uint32_t /* serialized_callback */)
 IPC_SYNC_MESSAGE_ROUTED1_1(
     PpapiHostMsg_PPBURLLoader_GetResponseInfo,
-    pp::proxy::HostResource /* loader */,
-    pp::proxy::HostResource /* response_info_out */)
+    ppapi::HostResource /* loader */,
+    ppapi::HostResource /* response_info_out */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_ReadResponseBody,
-                    pp::proxy::HostResource /* loader */,
+                    ppapi::HostResource /* loader */,
                     int32_t /* bytes_to_read */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FinishStreamingToFile,
-                    pp::proxy::HostResource /* loader */,
+                    ppapi::HostResource /* loader */,
                     uint32_t /* serialized_callback */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoader_Close,
-                    pp::proxy::HostResource /* loader */)
+                    ppapi::HostResource /* loader */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoader_GrantUniversalAccess,
-                    pp::proxy::HostResource /* loader */)
+                    ppapi::HostResource /* loader */)
 
 // PPB_URLRequestInfo.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLRequestInfo_Create,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLRequestInfo_SetProperty,
-                    pp::proxy::HostResource /* request */,
+                    ppapi::HostResource /* request */,
                     int32_t /* property */,
                     pp::proxy::SerializedVar /* value */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody,
-                    pp::proxy::HostResource /* request */,
+                    ppapi::HostResource /* request */,
                     std::string /* data */)
 IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody,
-                    pp::proxy::HostResource /* request */,
-                    pp::proxy::HostResource /* file_ref */,
+                    ppapi::HostResource /* request */,
+                    ppapi::HostResource /* file_ref */,
                     int64_t /* start_offset */,
                     int64_t /* number_of_bytes */,
                     double /* expected_last_modified_time */)
 
 // PPB_URLResponseInfo.
 IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBURLResponseInfo_GetProperty,
-                           pp::proxy::HostResource /* response */,
+                           ppapi::HostResource /* response */,
                            int32_t /* property */,
                            pp::proxy::SerializedVar /* result */)
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef,
-                           pp::proxy::HostResource /* response */,
+                           ppapi::HostResource /* response */,
                            pp::proxy::PPBFileRef_CreateInfo /* result */)
 
 // PPB_URLUtil.
@@ -965,50 +965,50 @@
                            PP_Instance /* instance */,
                            PP_Size /* size */,
                            PP_Bool /* is_always_opaque */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_ResourceCreation_ImageData,
                            PP_Instance /* instance */,
                            int32 /* format */,
                            PP_Size /* size */,
                            PP_Bool /* init_to_zero */,
-                           pp::proxy::HostResource /* result_resource */,
+                           ppapi::HostResource /* result_resource */,
                            std::string /* image_data_desc */,
                            pp::proxy::ImageHandle /* result */)
 
 // PPB_VideoCapture_Dev.
 IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBVideoCapture_Create,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBVideoCapture_StartCapture,
-                    pp::proxy::HostResource /* video_capture */,
+                    ppapi::HostResource /* video_capture */,
                     PP_VideoCaptureDeviceInfo_Dev /* requested_info */,
                     uint32_t /* buffer_count */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBVideoCapture_ReuseBuffer,
-                    pp::proxy::HostResource /* video_capture */,
+                    ppapi::HostResource /* video_capture */,
                     uint32_t /* buffer */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoCapture_StopCapture,
-                    pp::proxy::HostResource /* video_capture */)
+                    ppapi::HostResource /* video_capture */)
 
 // PPB_VideoDecoder.
 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVideoDecoder_Create,
                            PP_Instance /* instance */,
-                           pp::proxy::HostResource /* context */,
+                           ppapi::HostResource /* context */,
                            std::vector<PP_VideoConfigElement> /* config */,
-                           pp::proxy::HostResource /* result */)
+                           ppapi::HostResource /* result */)
 IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBVideoDecoder_Decode,
-                    pp::proxy::HostResource /* video_decoder */,
-                    pp::proxy::HostResource /* bitstream buffer */,
+                    ppapi::HostResource /* video_decoder */,
+                    ppapi::HostResource /* bitstream buffer */,
                     int32 /* bitstream buffer id */,
                     int32 /* size of buffer */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBVideoDecoder_AssignPictureBuffers,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     std::vector<PP_PictureBuffer_Dev> /* picture buffers */)
 IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBVideoDecoder_ReusePictureBuffer,
-                    pp::proxy::HostResource /* video_decoder */,
+                    ppapi::HostResource /* video_decoder */,
                     int32_t /* picture buffer id */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoDecoder_Flush,
-                    pp::proxy::HostResource /* video_decoder */)
+                    ppapi::HostResource /* video_decoder */)
 IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoDecoder_Reset,
-                    pp::proxy::HostResource /* video_decoder */)
+                    ppapi::HostResource /* video_decoder */)
 IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBVideoDecoder_Destroy,
-                           pp::proxy::HostResource /* video_decoder */)
+                           ppapi::HostResource /* video_decoder */)
diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc
index 29e51bb..bca08ee 100644
--- a/ppapi/proxy/ppapi_param_traits.cc
+++ b/ppapi/proxy/ppapi_param_traits.cc
@@ -9,11 +9,11 @@
 #include "ppapi/c/pp_file_info.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/private/ppb_flash_tcp_socket.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/serialized_var.h"
 #include "ppapi/proxy/serialized_flash_menu.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 namespace IPC {
 
@@ -197,7 +197,7 @@
     Message* m,
     const param_type& p) {
   ParamTraits<PP_Instance>::Write(m, p.instance);
-  ParamTraits<pp::proxy::HostResource>::Write(m, p.image_data);
+  ParamTraits<ppapi::HostResource>::Write(m, p.image_data);
   ParamTraits<pp::proxy::SerializedFontDescription>::Write(m, p.font_desc);
   ParamTraits<uint32_t>::Write(m, p.color);
   ParamTraits<PP_Point>::Write(m, p.position);
@@ -222,8 +222,7 @@
     param_type* r) {
   return
       ParamTraits<PP_Instance>::Read(m, iter, &r->instance) &&
-      ParamTraits<pp::proxy::HostResource>::Read(m, iter,
-                                                       &r->image_data) &&
+      ParamTraits<ppapi::HostResource>::Read(m, iter, &r->image_data) &&
       ParamTraits<pp::proxy::SerializedFontDescription>::Read(m, iter,
                                                               &r->font_desc) &&
       ParamTraits<uint32_t>::Read(m, iter, &r->color) &&
@@ -255,7 +254,7 @@
 void ParamTraits<pp::proxy::PPBFileRef_CreateInfo>::Write(
     Message* m,
     const param_type& p) {
-  ParamTraits<pp::proxy::HostResource>::Write(m, p.resource);
+  ParamTraits<ppapi::HostResource>::Write(m, p.resource);
   ParamTraits<int>::Write(m, p.file_system_type);
   ParamTraits<pp::proxy::SerializedVar>::Write(m, p.path);
   ParamTraits<pp::proxy::SerializedVar>::Write(m, p.name);
@@ -266,7 +265,7 @@
                                                          void** iter,
                                                          param_type* r) {
   return
-      ParamTraits<pp::proxy::HostResource>::Read(m, iter, &r->resource) &&
+      ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) &&
       ParamTraits<int>::Read(m, iter, &r->file_system_type) &&
       ParamTraits<pp::proxy::SerializedVar>::Read(m, iter, &r->path) &&
       ParamTraits<pp::proxy::SerializedVar>::Read(m, iter, &r->name);
@@ -285,7 +284,7 @@
     Message* m,
     const param_type& p) {
   ParamTraits<PP_Instance>::Write(m, p.instance);
-  ParamTraits<pp::proxy::HostResource>::Write(m, p.resource);
+  ParamTraits<ppapi::HostResource>::Write(m, p.resource);
   ParamTraits<int64_t>::Write(m, p.bytes_sent);
   ParamTraits<int64_t>::Write(m, p.total_bytes_to_be_sent);
   ParamTraits<int64_t>::Write(m, p.bytes_received);
@@ -299,7 +298,7 @@
     param_type* r) {
   return
       ParamTraits<PP_Instance>::Read(m, iter, &r->instance) &&
-      ParamTraits<pp::proxy::HostResource>::Read(m, iter, &r->resource) &&
+      ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) &&
       ParamTraits<int64_t>::Read(m, iter, &r->bytes_sent) &&
       ParamTraits<int64_t>::Read(m, iter, &r->total_bytes_to_be_sent) &&
       ParamTraits<int64_t>::Read(m, iter, &r->bytes_received) &&
@@ -372,17 +371,17 @@
     std::string* l) {
 }
 
-// HostResource ----------------------------------------------------------
+// HostResource ----------------------------------------------------------------
 
 // static
-void ParamTraits<pp::proxy::HostResource>::Write(Message* m,
+void ParamTraits<ppapi::HostResource>::Write(Message* m,
                                                  const param_type& p) {
   ParamTraits<PP_Instance>::Write(m, p.instance());
   ParamTraits<PP_Resource>::Write(m, p.host_resource());
 }
 
 // static
-bool ParamTraits<pp::proxy::HostResource>::Read(const Message* m,
+bool ParamTraits<ppapi::HostResource>::Read(const Message* m,
                                                 void** iter,
                                                 param_type* r) {
   PP_Instance instance;
@@ -395,8 +394,8 @@
 }
 
 // static
-void ParamTraits<pp::proxy::HostResource>::Log(const param_type& p,
-                                               std::string* l) {
+void ParamTraits<ppapi::HostResource>::Log(const param_type& p,
+                                           std::string* l) {
 }
 
 // SerializedVar ---------------------------------------------------------------
diff --git a/ppapi/proxy/ppapi_param_traits.h b/ppapi/proxy/ppapi_param_traits.h
index 736120f2..4cd425a 100644
--- a/ppapi/proxy/ppapi_param_traits.h
+++ b/ppapi/proxy/ppapi_param_traits.h
@@ -19,10 +19,15 @@
 struct PP_Flash_Menu;
 struct PP_Flash_NetAddress;
 
+namespace ppapi {
+
+class HostResource;
+
+}  // namespace ppapi
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
 struct PPBFileRef_CreateInfo;
 struct PPBFlash_DrawGlyphs_Params;
 struct PPBURLLoader_UpdateProgress_Params;
@@ -109,8 +114,8 @@
 };
 
 template<>
-struct ParamTraits<pp::proxy::HostResource> {
-  typedef pp::proxy::HostResource param_type;
+struct ParamTraits<ppapi::HostResource> {
+  typedef ppapi::HostResource param_type;
   static void Write(Message* m, const param_type& p);
   static bool Read(const Message* m, void** iter, param_type* r);
   static void Log(const param_type& p, std::string* l);
diff --git a/ppapi/proxy/ppb_audio_config_proxy.cc b/ppapi/proxy/ppb_audio_config_proxy.cc
index f202b63..f2eb9d8b 100644
--- a/ppapi/proxy/ppb_audio_config_proxy.cc
+++ b/ppapi/proxy/ppb_audio_config_proxy.cc
@@ -11,6 +11,8 @@
 #include "ppapi/shared_impl/audio_config_impl.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_audio_config_proxy.h b/ppapi/proxy/ppb_audio_config_proxy.h
index e8a12e8..5bbfa30 100644
--- a/ppapi/proxy/ppb_audio_config_proxy.h
+++ b/ppapi/proxy/ppb_audio_config_proxy.h
@@ -16,8 +16,6 @@
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_AudioConfig_Proxy : public InterfaceProxy {
  public:
   PPB_AudioConfig_Proxy(Dispatcher* dispatcher, const void* target_interface);
diff --git a/ppapi/proxy/ppb_audio_proxy.cc b/ppapi/proxy/ppb_audio_proxy.cc
index 9ec3b30..c6562ec 100644
--- a/ppapi/proxy/ppb_audio_proxy.cc
+++ b/ppapi/proxy/ppb_audio_proxy.cc
@@ -22,6 +22,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Audio_API;
 using ppapi::thunk::PPB_AudioConfig_API;
diff --git a/ppapi/proxy/ppb_audio_proxy.h b/ppapi/proxy/ppb_audio_proxy.h
index e39a82d..78abbbc0 100644
--- a/ppapi/proxy/ppb_audio_proxy.h
+++ b/ppapi/proxy/ppb_audio_proxy.h
@@ -22,11 +22,13 @@
 
 struct PPB_Audio;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_Audio_Proxy : public InterfaceProxy {
  public:
   PPB_Audio_Proxy(Dispatcher* dispatcher, const void* target_interface);
@@ -53,18 +55,18 @@
   void OnMsgCreate(PP_Instance instance_id,
                    int32_t sample_rate,
                    uint32_t sample_frame_count,
-                   HostResource* result);
-  void OnMsgStartOrStop(const HostResource& audio_id, bool play);
+                   ppapi::HostResource* result);
+  void OnMsgStartOrStop(const ppapi::HostResource& audio_id, bool play);
 
   // Renderer->plugin message handlers.
-  void OnMsgNotifyAudioStreamCreated(const HostResource& audio_id,
+  void OnMsgNotifyAudioStreamCreated(const ppapi::HostResource& audio_id,
                                      int32_t result_code,
                                      IPC::PlatformFileForTransit socket_handle,
                                      base::SharedMemoryHandle handle,
                                      uint32_t length);
 
   void AudioChannelConnected(int32_t result,
-                             const HostResource& resource);
+                             const ppapi::HostResource& resource);
 
   // In the renderer, this is called in response to a stream created message.
   // It will retrieve the shared memory and socket handles and place them into
@@ -75,7 +77,7 @@
   // arguments may be written to, and others may be untouched, depending on
   // where the error occurred.
   int32_t GetAudioConnectedHandles(
-      const HostResource& resource,
+      const ppapi::HostResource& resource,
       IPC::PlatformFileForTransit* foreign_socket_handle,
       base::SharedMemoryHandle* foreign_shared_memory_handle,
       uint32_t* shared_memory_length);
diff --git a/ppapi/proxy/ppb_broker_proxy.cc b/ppapi/proxy/ppb_broker_proxy.cc
index cc2bf86..ac99699 100644
--- a/ppapi/proxy/ppb_broker_proxy.cc
+++ b/ppapi/proxy/ppb_broker_proxy.cc
@@ -14,6 +14,7 @@
 #include "ppapi/thunk/enter.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::PPB_Broker_API;
 
 namespace pp {
diff --git a/ppapi/proxy/ppb_broker_proxy.h b/ppapi/proxy/ppb_broker_proxy.h
index efa9a985..f50291e 100644
--- a/ppapi/proxy/ppb_broker_proxy.h
+++ b/ppapi/proxy/ppb_broker_proxy.h
@@ -12,14 +12,15 @@
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
 
-
 struct PPB_BrokerTrusted;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_Broker_Proxy : public InterfaceProxy {
  public:
   PPB_Broker_Proxy(Dispatcher* dispatcher, const void* target_interface);
@@ -38,13 +39,14 @@
 
  private:
   // Message handlers.
-  void OnMsgCreate(PP_Instance instance, HostResource* result_resource);
-  void OnMsgConnect(const HostResource& broker);
-  void OnMsgConnectComplete(const HostResource& broker,
+  void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource);
+  void OnMsgConnect(const ppapi::HostResource& broker);
+  void OnMsgConnectComplete(const ppapi::HostResource& broker,
                             IPC::PlatformFileForTransit foreign_socket_handle,
                             int32_t result);
 
-  void ConnectCompleteInHost(int32_t result, const HostResource& host_resource);
+  void ConnectCompleteInHost(int32_t result,
+                             const ppapi::HostResource& host_resource);
 
   CompletionCallbackFactory<PPB_Broker_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_buffer_proxy.cc b/ppapi/proxy/ppb_buffer_proxy.cc
index f25d7e2..558b531 100644
--- a/ppapi/proxy/ppb_buffer_proxy.cc
+++ b/ppapi/proxy/ppb_buffer_proxy.cc
@@ -19,6 +19,8 @@
 #include "ppapi/thunk/ppb_buffer_trusted_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_buffer_proxy.h b/ppapi/proxy/ppb_buffer_proxy.h
index 18ddafc..02e47f8 100644
--- a/ppapi/proxy/ppb_buffer_proxy.h
+++ b/ppapi/proxy/ppb_buffer_proxy.h
@@ -13,15 +13,17 @@
 
 struct PPB_Buffer_Dev;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class Buffer : public ppapi::thunk::PPB_Buffer_API,
                public PluginResource {
  public:
-  Buffer(const HostResource& resource,
+  Buffer(const ppapi::HostResource& resource,
          const base::SharedMemoryHandle& shm_handle,
          uint32_t size);
   virtual ~Buffer();
@@ -53,7 +55,7 @@
 
   static PP_Resource CreateProxyResource(PP_Instance instance,
                                          uint32_t size);
-  static PP_Resource AddProxyResource(const HostResource& resource,
+  static PP_Resource AddProxyResource(const ppapi::HostResource& resource,
                                       base::SharedMemoryHandle shm_handle,
                                       uint32_t size);
 
@@ -68,7 +70,7 @@
   // Message handlers.
   void OnMsgCreate(PP_Instance instance,
                    uint32_t size,
-                   HostResource* result_resource,
+                   ppapi::HostResource* result_resource,
                    base::SharedMemoryHandle* result_shm_handle);
 };
 
diff --git a/ppapi/proxy/ppb_context_3d_proxy.cc b/ppapi/proxy/ppb_context_3d_proxy.cc
index 1c33a22..3b1bd37 100644
--- a/ppapi/proxy/ppb_context_3d_proxy.cc
+++ b/ppapi/proxy/ppb_context_3d_proxy.cc
@@ -20,6 +20,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Context3D_API;
diff --git a/ppapi/proxy/ppb_context_3d_proxy.h b/ppapi/proxy/ppb_context_3d_proxy.h
index ec9ece2..017c2a1 100644
--- a/ppapi/proxy/ppb_context_3d_proxy.h
+++ b/ppapi/proxy/ppb_context_3d_proxy.h
@@ -37,7 +37,7 @@
 class Context3D : public PluginResource,
                   public ppapi::thunk::PPB_Context3D_API {
  public:
-  explicit Context3D(const HostResource& resource);
+  explicit Context3D(const ppapi::HostResource& resource);
   virtual ~Context3D();
 
   // ResourceObjectBase overrides.
@@ -112,28 +112,28 @@
   void OnMsgCreate(PP_Instance instance,
                    PP_Config3D_Dev config,
                    const std::vector<int32_t>& attribs,
-                   HostResource* result);
-  void OnMsgBindSurfaces(const HostResource& context,
-                         const HostResource& draw,
-                         const HostResource& read,
+                   ppapi::HostResource* result);
+  void OnMsgBindSurfaces(const ppapi::HostResource& context,
+                         const ppapi::HostResource& draw,
+                         const ppapi::HostResource& read,
                          int32_t* result);
-  void OnMsgInitialize(const HostResource& context,
+  void OnMsgInitialize(const ppapi::HostResource& context,
                        int32 size,
                        base::SharedMemoryHandle* ring_buffer);
-  void OnMsgGetState(const HostResource& context,
+  void OnMsgGetState(const ppapi::HostResource& context,
                      gpu::CommandBuffer::State* state);
-  void OnMsgFlush(const HostResource& context,
+  void OnMsgFlush(const ppapi::HostResource& context,
                   int32 put_offset,
                   int32 last_known_get,
                   gpu::CommandBuffer::State* state);
-  void OnMsgAsyncFlush(const HostResource& context,
+  void OnMsgAsyncFlush(const ppapi::HostResource& context,
                        int32 put_offset);
-  void OnMsgCreateTransferBuffer(const HostResource& context,
+  void OnMsgCreateTransferBuffer(const ppapi::HostResource& context,
                                  int32 size,
                                  int32* id);
-  void OnMsgDestroyTransferBuffer(const HostResource& context,
+  void OnMsgDestroyTransferBuffer(const ppapi::HostResource& context,
                                   int32 id);
-  void OnMsgGetTransferBuffer(const HostResource& context,
+  void OnMsgGetTransferBuffer(const ppapi::HostResource& context,
                               int32 id,
                               base::SharedMemoryHandle* transfer_buffer,
                               uint32* size);
diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc
index 391a914..41b33013 100644
--- a/ppapi/proxy/ppb_core_proxy.cc
+++ b/ppapi/proxy/ppb_core_proxy.cc
@@ -19,6 +19,7 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/shared_impl/time_conversion.h"
 
+using ppapi::HostResource;
 using ppapi::TimeToPPTime;
 using ppapi::TimeTicksToPPTimeTicks;
 
@@ -118,11 +119,11 @@
   return handled;
 }
 
-void PPB_Core_Proxy::OnMsgAddRefResource(HostResource resource) {
+void PPB_Core_Proxy::OnMsgAddRefResource(const HostResource& resource) {
   ppb_core_target()->AddRefResource(resource.host_resource());
 }
 
-void PPB_Core_Proxy::OnMsgReleaseResource(HostResource resource) {
+void PPB_Core_Proxy::OnMsgReleaseResource(const HostResource& resource) {
   ppb_core_target()->ReleaseResource(resource.host_resource());
 }
 
diff --git a/ppapi/proxy/ppb_core_proxy.h b/ppapi/proxy/ppb_core_proxy.h
index 6ad8b315..14c88e5 100644
--- a/ppapi/proxy/ppb_core_proxy.h
+++ b/ppapi/proxy/ppb_core_proxy.h
@@ -8,8 +8,8 @@
 #include "ppapi/c/pp_completion_callback.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/pp_var.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_Core;
 
@@ -32,8 +32,8 @@
 
  private:
   // Message handlers.
-  void OnMsgAddRefResource(HostResource resource);
-  void OnMsgReleaseResource(HostResource resource);
+  void OnMsgAddRefResource(const ppapi::HostResource& resource);
+  void OnMsgReleaseResource(const ppapi::HostResource& resource);
 };
 
 }  // namespace proxy
diff --git a/ppapi/proxy/ppb_cursor_control_proxy.cc b/ppapi/proxy/ppb_cursor_control_proxy.cc
index 993efe8..19ea104 100644
--- a/ppapi/proxy/ppb_cursor_control_proxy.cc
+++ b/ppapi/proxy/ppb_cursor_control_proxy.cc
@@ -13,6 +13,7 @@
 #include "ppapi/thunk/enter.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_CursorControl_FunctionAPI;
 
@@ -128,7 +129,7 @@
 
 void PPB_CursorControl_Proxy::OnMsgSetCursor(PP_Instance instance,
                                              int32_t type,
-                                             HostResource custom_image,
+                                             const HostResource& custom_image,
                                              const PP_Point& hot_spot,
                                              PP_Bool* result) {
   EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true);
diff --git a/ppapi/proxy/ppb_cursor_control_proxy.h b/ppapi/proxy/ppb_cursor_control_proxy.h
index 8657dc9..40bc600 100644
--- a/ppapi/proxy/ppb_cursor_control_proxy.h
+++ b/ppapi/proxy/ppb_cursor_control_proxy.h
@@ -10,9 +10,9 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_point.h"
 #include "ppapi/c/pp_resource.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/shared_impl/function_group_base.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/thunk/ppb_cursor_control_api.h"
 
 struct PPB_CursorControl_Dev;
@@ -51,7 +51,7 @@
   // Message handlers.
   void OnMsgSetCursor(PP_Instance instance,
                       int32_t type,
-                      HostResource custom_image,
+                      const ppapi::HostResource& custom_image,
                       const PP_Point& hot_spot,
                       PP_Bool* result);
   void OnMsgLockCursor(PP_Instance instance,
diff --git a/ppapi/proxy/ppb_file_chooser_proxy.cc b/ppapi/proxy/ppb_file_chooser_proxy.cc
index a5bb745..4999e18 100644
--- a/ppapi/proxy/ppb_file_chooser_proxy.cc
+++ b/ppapi/proxy/ppb_file_chooser_proxy.cc
@@ -18,7 +18,8 @@
 #include "ppapi/proxy/serialized_var.h"
 #include "ppapi/thunk/thunk.h"
 
-using ::ppapi::thunk::PPB_FileChooser_API;
+using ppapi::HostResource;
+using ppapi::thunk::PPB_FileChooser_API;
 
 namespace pp {
 namespace proxy {
diff --git a/ppapi/proxy/ppb_file_chooser_proxy.h b/ppapi/proxy/ppb_file_chooser_proxy.h
index 4b83e950..513399e 100644
--- a/ppapi/proxy/ppb_file_chooser_proxy.h
+++ b/ppapi/proxy/ppb_file_chooser_proxy.h
@@ -17,10 +17,13 @@
 
 struct PPB_FileChooser_Dev;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
 struct PPBFileRef_CreateInfo;
 
 class PPB_FileChooser_Proxy : public InterfaceProxy {
@@ -46,18 +49,18 @@
   void OnMsgCreate(PP_Instance instance,
                    int mode,
                    const std::string& accept_mime_types,
-                   pp::proxy::HostResource* result);
-  void OnMsgShow(const pp::proxy::HostResource& chooser);
+                   ppapi::HostResource* result);
+  void OnMsgShow(const ppapi::HostResource& chooser);
 
   // Host -> plugin message handlers.
   void OnMsgChooseComplete(
-      const pp::proxy::HostResource& chooser,
+      const ppapi::HostResource& chooser,
       int32_t result_code,
       const std::vector<PPBFileRef_CreateInfo>& chosen_files);
 
   // Called when the show is complete in the host. This will notify the plugin
   // via IPC and OnMsgChooseComplete will be called there.
-  void OnShowCallback(int32_t result, const HostResource& chooser);
+  void OnShowCallback(int32_t result, const ppapi::HostResource& chooser);
 
   CompletionCallbackFactory<PPB_FileChooser_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_file_ref_proxy.cc b/ppapi/proxy/ppb_file_ref_proxy.cc
index d94a3f2..a72519d 100644
--- a/ppapi/proxy/ppb_file_ref_proxy.cc
+++ b/ppapi/proxy/ppb_file_ref_proxy.cc
@@ -17,6 +17,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_FileRef_API;
diff --git a/ppapi/proxy/ppb_file_ref_proxy.h b/ppapi/proxy/ppb_file_ref_proxy.h
index 076bea2..d03a9dd 100644
--- a/ppapi/proxy/ppb_file_ref_proxy.h
+++ b/ppapi/proxy/ppb_file_ref_proxy.h
@@ -15,10 +15,13 @@
 
 struct PPB_FileRef_Dev;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
 struct PPBFileRef_CreateInfo;
 
 class PPB_FileRef_Proxy : public InterfaceProxy {
@@ -58,22 +61,22 @@
 
  private:
   // Message handlers.
-  void OnMsgCreate(const HostResource& file_system,
+  void OnMsgCreate(const ppapi::HostResource& file_system,
                    const std::string& path,
                    PPBFileRef_CreateInfo* result);
-  void OnMsgGetParent(const HostResource& host_resource,
+  void OnMsgGetParent(const ppapi::HostResource& host_resource,
                       PPBFileRef_CreateInfo* result);
-  void OnMsgMakeDirectory(const HostResource& host_resource,
+  void OnMsgMakeDirectory(const ppapi::HostResource& host_resource,
                           PP_Bool make_ancestors,
                           uint32_t serialized_callback);
-  void OnMsgTouch(const HostResource& host_resource,
+  void OnMsgTouch(const ppapi::HostResource& host_resource,
                   PP_Time last_access,
                   PP_Time last_modified,
                   uint32_t serialized_callback);
-  void OnMsgDelete(const HostResource& host_resource,
+  void OnMsgDelete(const ppapi::HostResource& host_resource,
                    uint32_t serialized_callback);
-  void OnMsgRename(const HostResource& file_ref,
-                   const HostResource& new_file_ref,
+  void OnMsgRename(const ppapi::HostResource& file_ref,
+                   const ppapi::HostResource& new_file_ref,
                    uint32_t serialized_callback);
 
   DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Proxy);
diff --git a/ppapi/proxy/ppb_file_system_proxy.cc b/ppapi/proxy/ppb_file_system_proxy.cc
index 4851144..98a1a7f 100644
--- a/ppapi/proxy/ppb_file_system_proxy.cc
+++ b/ppapi/proxy/ppb_file_system_proxy.cc
@@ -19,6 +19,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_FileSystem_API;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/ppb_file_system_proxy.h b/ppapi/proxy/ppb_file_system_proxy.h
index dcf94b37..795abcb9 100644
--- a/ppapi/proxy/ppb_file_system_proxy.h
+++ b/ppapi/proxy/ppb_file_system_proxy.h
@@ -18,11 +18,13 @@
 
 struct PPB_FileSystem_Dev;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_FileSystem_Proxy : public InterfaceProxy {
  public:
   PPB_FileSystem_Proxy(Dispatcher* dispatcher, const void* target_interface);
@@ -40,14 +42,15 @@
   // Message handlers.
   void OnMsgCreate(PP_Instance instance,
                    int type,
-                   HostResource* result);
-  void OnMsgOpen(const HostResource& filesystem,
+                   ppapi::HostResource* result);
+  void OnMsgOpen(const ppapi::HostResource& filesystem,
                  int64_t expected_size);
 
-  void OnMsgOpenComplete(const HostResource& filesystem,
+  void OnMsgOpenComplete(const ppapi::HostResource& filesystem,
                          int32_t result);
 
-  void OpenCompleteInHost(int32_t result, const HostResource& host_resource);
+  void OpenCompleteInHost(int32_t result,
+                          const ppapi::HostResource& host_resource);
 
   CompletionCallbackFactory<PPB_FileSystem_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_flash_file_proxy.cc b/ppapi/proxy/ppb_flash_file_proxy.cc
index 7b6dc2d..825f02e 100644
--- a/ppapi/proxy/ppb_flash_file_proxy.cc
+++ b/ppapi/proxy/ppb_flash_file_proxy.cc
@@ -23,6 +23,8 @@
 #include "ppapi/proxy/plugin_resource.h"
 #include "ppapi/proxy/ppapi_messages.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_flash_file_proxy.h b/ppapi/proxy/ppb_flash_file_proxy.h
index e09ae54..3a007fe 100644
--- a/ppapi/proxy/ppb_flash_file_proxy.h
+++ b/ppapi/proxy/ppb_flash_file_proxy.h
@@ -17,10 +17,13 @@
 struct PPB_Flash_File_FileRef;
 struct PPB_Flash_File_ModuleLocal;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
 struct SerializedDirEntry;
 
 class PPB_Flash_File_ModuleLocal_Proxy : public InterfaceProxy {
@@ -83,11 +86,11 @@
 
  private:
   // Message handlers.
-  void OnMsgOpenFile(const HostResource& host_resource,
+  void OnMsgOpenFile(const ppapi::HostResource& host_resource,
                      int32_t mode,
                      IPC::PlatformFileForTransit* file_handle,
                      int32_t* result);
-  void OnMsgQueryFile(const HostResource& host_resource,
+  void OnMsgQueryFile(const ppapi::HostResource& host_resource,
                       PP_FileInfo* info,
                       int32_t* result);
 };
diff --git a/ppapi/proxy/ppb_flash_menu_proxy.cc b/ppapi/proxy/ppb_flash_menu_proxy.cc
index c3d26aa..c2b74a2 100644
--- a/ppapi/proxy/ppb_flash_menu_proxy.cc
+++ b/ppapi/proxy/ppb_flash_menu_proxy.cc
@@ -13,6 +13,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_Flash_Menu_API;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/ppb_flash_menu_proxy.h b/ppapi/proxy/ppb_flash_menu_proxy.h
index d999905..979abee5 100644
--- a/ppapi/proxy/ppb_flash_menu_proxy.h
+++ b/ppapi/proxy/ppb_flash_menu_proxy.h
@@ -36,10 +36,10 @@
 
   void OnMsgCreate(PP_Instance instance_id,
                    const SerializedFlashMenu& menu_data,
-                   HostResource* resource);
-  void OnMsgShow(const HostResource& menu,
+                   ppapi::HostResource* resource);
+  void OnMsgShow(const ppapi::HostResource& menu,
                  const PP_Point& location);
-  void OnMsgShowACK(const HostResource& menu,
+  void OnMsgShowACK(const ppapi::HostResource& menu,
                     int32_t selected_id,
                     int32_t result);
   void SendShowACKToPlugin(int32_t result, ShowRequest* request);
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.cc b/ppapi/proxy/ppb_flash_net_connector_proxy.cc
index 6d5a9ce..0d934280 100644
--- a/ppapi/proxy/ppb_flash_net_connector_proxy.cc
+++ b/ppapi/proxy/ppb_flash_net_connector_proxy.cc
@@ -18,6 +18,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_Flash_NetConnector_API;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.h b/ppapi/proxy/ppb_flash_net_connector_proxy.h
index 67647c2..d43bd623 100644
--- a/ppapi/proxy/ppb_flash_net_connector_proxy.h
+++ b/ppapi/proxy/ppb_flash_net_connector_proxy.h
@@ -14,11 +14,13 @@
 
 struct PPB_Flash_NetConnector;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_Flash_NetConnector_Proxy : public InterfaceProxy {
  public:
   PPB_Flash_NetConnector_Proxy(Dispatcher* dispatcher,
@@ -37,15 +39,15 @@
 
   // Plugin->host message handlers.
   void OnMsgCreate(PP_Instance instance,
-                   HostResource* result);
-  void OnMsgConnectTcp(const HostResource& resource,
+                   ppapi::HostResource* result);
+  void OnMsgConnectTcp(const ppapi::HostResource& resource,
                        const std::string& host,
                        uint16_t port);
-  void OnMsgConnectTcpAddress(const HostResource& resource_id,
+  void OnMsgConnectTcpAddress(const ppapi::HostResource& resource_id,
                               const std::string& net_address_as_string);
 
   // Host->plugin message handler.
-  void OnMsgConnectACK(const HostResource& host_resource,
+  void OnMsgConnectACK(const ppapi::HostResource& host_resource,
                        int32_t result,
                        IPC::PlatformFileForTransit handle,
                        const std::string& load_addr_as_string,
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index c430b053..289a864 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -19,6 +19,8 @@
 #include "ppapi/proxy/proxy_module.h"
 #include "ppapi/proxy/serialized_var.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_flash_proxy.h b/ppapi/proxy/ppb_flash_proxy.h
index 83161351..27ec0c2a 100644
--- a/ppapi/proxy/ppb_flash_proxy.h
+++ b/ppapi/proxy/ppb_flash_proxy.h
@@ -12,8 +12,8 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_module.h"
 #include "ppapi/c/pp_time.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PP_FileInfo;
 struct PPB_Flash;
@@ -47,7 +47,7 @@
   void OnMsgGetProxyForURL(PP_Instance instance,
                            const std::string& url,
                            SerializedVarReturnValue result);
-  void OnMsgNavigate(const HostResource& request_info,
+  void OnMsgNavigate(const ppapi::HostResource& request_info,
                      const std::string& target,
                      bool from_user_action,
                      int32_t* result);
diff --git a/ppapi/proxy/ppb_flash_tcp_socket_proxy.cc b/ppapi/proxy/ppb_flash_tcp_socket_proxy.cc
index c474ed00..abe8a2d8 100644
--- a/ppapi/proxy/ppb_flash_tcp_socket_proxy.cc
+++ b/ppapi/proxy/ppb_flash_tcp_socket_proxy.cc
@@ -20,6 +20,7 @@
 #include "ppapi/thunk/ppb_flash_tcp_socket_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::PPB_Flash_TCPSocket_API;
 
 namespace pp {
diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc
index a977a1f9..392481ba 100644
--- a/ppapi/proxy/ppb_font_proxy.cc
+++ b/ppapi/proxy/ppb_font_proxy.cc
@@ -18,6 +18,7 @@
 #include "ppapi/thunk/ppb_image_data_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::StringVar;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_ImageData_API;
diff --git a/ppapi/proxy/ppb_font_proxy.h b/ppapi/proxy/ppb_font_proxy.h
index 86c1fa8..8058fdf 100644
--- a/ppapi/proxy/ppb_font_proxy.h
+++ b/ppapi/proxy/ppb_font_proxy.h
@@ -7,9 +7,9 @@
 
 #include "base/basictypes.h"
 #include "base/synchronization/waitable_event.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/webkit_forwarding.h"
 #include "ppapi/thunk/ppb_font_api.h"
 
@@ -50,7 +50,7 @@
   // resource should be 0. However, various code assumes the instance in the
   // host resource is valid (this is how resources are associated with
   // instances), so that should be set.
-  Font(const HostResource& resource, const PP_FontDescription_Dev& desc);
+  Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc);
   virtual ~Font();
 
   // ResourceObjectBase.
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.cc b/ppapi/proxy/ppb_graphics_2d_proxy.cc
index a003792..eaa1032 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.cc
@@ -20,7 +20,8 @@
 #include "ppapi/thunk/ppb_graphics_2d_api.h"
 #include "ppapi/thunk/thunk.h"
 
-using ::ppapi::thunk::PPB_Graphics2D_API;
+using ppapi::HostResource;
+using ppapi::thunk::PPB_Graphics2D_API;
 
 namespace pp {
 namespace proxy {
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.h b/ppapi/proxy/ppb_graphics_2d_proxy.h
index 9be7f839..77f0dd6 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.h
@@ -13,10 +13,10 @@
 #include "ppapi/c/pp_size.h"
 #include "ppapi/c/pp_var.h"
 #include "ppapi/cpp/completion_callback.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/proxy/plugin_resource.h"
 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_Graphics2D;
 struct PP_Point;
@@ -45,26 +45,26 @@
 
  private:
   // Plugin->renderer message handlers.
-  void OnMsgPaintImageData(const HostResource& graphics_2d,
-                           const HostResource& image_data,
+  void OnMsgPaintImageData(const ppapi::HostResource& graphics_2d,
+                           const ppapi::HostResource& image_data,
                            const PP_Point& top_left,
                            bool src_rect_specified,
                            const PP_Rect& src_rect);
-  void OnMsgScroll(const HostResource& graphics_2d,
+  void OnMsgScroll(const ppapi::HostResource& graphics_2d,
                    bool clip_specified,
                    const PP_Rect& clip,
                    const PP_Point& amount);
-  void OnMsgReplaceContents(const HostResource& graphics_2d,
-                            const HostResource& image_data);
-  void OnMsgFlush(const HostResource& graphics_2d);
+  void OnMsgReplaceContents(const ppapi::HostResource& graphics_2d,
+                            const ppapi::HostResource& image_data);
+  void OnMsgFlush(const ppapi::HostResource& graphics_2d);
 
   // Renderer->plugin message handlers.
-  void OnMsgFlushACK(const HostResource& graphics_2d,
+  void OnMsgFlushACK(const ppapi::HostResource& graphics_2d,
                      int32_t pp_error);
 
   // Called in the renderer to send the given flush ACK to the plugin.
   void SendFlushACKToPlugin(int32_t result,
-                            const HostResource& graphics_2d);
+                            const ppapi::HostResource& graphics_2d);
 
   CompletionCallbackFactory<PPB_Graphics2D_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index a82c9a5..1b4d32c7 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -13,6 +13,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Graphics3D_API;
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.h b/ppapi/proxy/ppb_graphics_3d_proxy.h
index 6ff3a10..173dc3c 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.h
@@ -17,15 +17,17 @@
 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
 #include "ppapi/shared_impl/graphics_3d_impl.h"
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class Graphics3D : public PluginResource,
                    public ppapi::Graphics3DImpl {
  public:
-  explicit Graphics3D(const HostResource& resource);
+  explicit Graphics3D(const ppapi::HostResource& resource);
   virtual ~Graphics3D();
 
   bool Init();
@@ -84,33 +86,34 @@
   void OnMsgCreate(PP_Instance instance,
                    PP_Config3D_Dev config,
                    const std::vector<int32_t>& attribs,
-                   HostResource* result);
-  void OnMsgInitCommandBuffer(const HostResource& context,
+                   ppapi::HostResource* result);
+  void OnMsgInitCommandBuffer(const ppapi::HostResource& context,
                               int32 size,
                               base::SharedMemoryHandle* ring_buffer);
-  void OnMsgGetState(const HostResource& context,
+  void OnMsgGetState(const ppapi::HostResource& context,
                      gpu::CommandBuffer::State* state);
-  void OnMsgFlush(const HostResource& context,
+  void OnMsgFlush(const ppapi::HostResource& context,
                   int32 put_offset,
                   int32 last_known_get,
                   gpu::CommandBuffer::State* state);
-  void OnMsgAsyncFlush(const HostResource& context,
+  void OnMsgAsyncFlush(const ppapi::HostResource& context,
                        int32 put_offset);
-  void OnMsgCreateTransferBuffer(const HostResource& context,
+  void OnMsgCreateTransferBuffer(const ppapi::HostResource& context,
                                  int32 size,
                                  int32* id);
-  void OnMsgDestroyTransferBuffer(const HostResource& context,
+  void OnMsgDestroyTransferBuffer(const ppapi::HostResource& context,
                                   int32 id);
-  void OnMsgGetTransferBuffer(const HostResource& context,
+  void OnMsgGetTransferBuffer(const ppapi::HostResource& context,
                               int32 id,
                               base::SharedMemoryHandle* transfer_buffer,
                               uint32* size);
-  void OnMsgSwapBuffers(const HostResource& context);
+  void OnMsgSwapBuffers(const ppapi::HostResource& context);
   // Renderer->plugin message handlers.
-  void OnMsgSwapBuffersACK(const HostResource& context, int32_t pp_error);
+  void OnMsgSwapBuffersACK(const ppapi::HostResource& context,
+                           int32_t pp_error);
 
   void SendSwapBuffersACKToPlugin(int32_t result,
-                                  const HostResource& context);
+                                  const ppapi::HostResource& context);
 
   CompletionCallbackFactory<PPB_Graphics3D_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc
index 46e44f4..dec6efc4b 100644
--- a/ppapi/proxy/ppb_image_data_proxy.cc
+++ b/ppapi/proxy/ppb_image_data_proxy.cc
@@ -13,14 +13,16 @@
 #include "ppapi/c/pp_completion_callback.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/c/pp_resource.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/plugin_dispatcher.h"
 #include "ppapi/proxy/plugin_resource_tracker.h"
 #include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/thunk/thunk.h"
 #include "skia/ext/platform_canvas.h"
 #include "ui/gfx/surface/transport_dib.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_image_data_proxy.h b/ppapi/proxy/ppb_image_data_proxy.h
index b23d725..75d3faf 100644
--- a/ppapi/proxy/ppb_image_data_proxy.h
+++ b/ppapi/proxy/ppb_image_data_proxy.h
@@ -21,6 +21,10 @@
 struct PPB_ImageData;
 class TransportDIB;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace skia {
 class PlatformCanvas;
 }
@@ -28,8 +32,6 @@
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_ImageData_Proxy : public InterfaceProxy {
  public:
   PPB_ImageData_Proxy(Dispatcher* dispatcher, const void* target_interface);
@@ -49,7 +51,7 @@
                   public ::ppapi::thunk::PPB_ImageData_API,
                   public ppapi::ImageDataImpl {
  public:
-  ImageData(const HostResource& resource,
+  ImageData(const ppapi::HostResource& resource,
             const PP_ImageDataDesc& desc,
             ImageHandle handle);
   virtual ~ImageData();
diff --git a/ppapi/proxy/ppb_input_event_proxy.cc b/ppapi/proxy/ppb_input_event_proxy.cc
index 056bd29a..593bf1e 100644
--- a/ppapi/proxy/ppb_input_event_proxy.cc
+++ b/ppapi/proxy/ppb_input_event_proxy.cc
@@ -13,6 +13,7 @@
 #include "ppapi/shared_impl/var.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::InputEventData;
 using ppapi::InputEventImpl;
 using ppapi::thunk::PPB_InputEvent_API;
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index a936688..08da58c 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -22,6 +22,7 @@
 #undef PostMessage
 #endif
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Instance_FunctionAPI;
@@ -290,7 +291,7 @@
 }
 
 void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance,
-                                           HostResource device,
+                                           const HostResource& device,
                                            PP_Bool* result) {
   EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false);
   if (enter.succeeded()) {
diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h
index 282f4a9..c2e8c6e 100644
--- a/ppapi/proxy/ppb_instance_proxy.h
+++ b/ppapi/proxy/ppb_instance_proxy.h
@@ -8,9 +8,9 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/pp_var.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/shared_impl/function_group_base.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/instance_impl.h"
 #include "ppapi/thunk/ppb_instance_api.h"
 
@@ -74,7 +74,7 @@
   void OnMsgGetOwnerElementObject(PP_Instance instance,
                                   SerializedVarReturnValue result);
   void OnMsgBindGraphics(PP_Instance instance,
-                         HostResource device,
+                         const ppapi::HostResource& device,
                          PP_Bool* result);
   void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result);
   void OnMsgExecuteScript(PP_Instance instance,
diff --git a/ppapi/proxy/ppb_pdf_proxy.cc b/ppapi/proxy/ppb_pdf_proxy.cc
index 14dcb8de..5711030 100644
--- a/ppapi/proxy/ppb_pdf_proxy.cc
+++ b/ppapi/proxy/ppb_pdf_proxy.cc
@@ -19,6 +19,7 @@
 #include "ppapi/thunk/enter.h"
 #include "ppapi/thunk/ppb_pdf_api.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::PPB_PDFFont_API;
 using ppapi::thunk::EnterResource;
 
diff --git a/ppapi/proxy/ppb_pdf_proxy.h b/ppapi/proxy/ppb_pdf_proxy.h
index dbafd2d..f0aba40 100644
--- a/ppapi/proxy/ppb_pdf_proxy.h
+++ b/ppapi/proxy/ppb_pdf_proxy.h
@@ -6,8 +6,8 @@
 #define PPAPI_PPB_PDF_PROXY_H_
 
 #include "ppapi/c/pp_module.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_PDF;
 
@@ -35,8 +35,8 @@
   void OnMsgGetFontFileWithFallback(PP_Module module,
                                     const SerializedFontDescription& desc,
                                     int32_t charset,
-                                    HostResource* result);
-  void OnMsgGetFontTableForPrivateFontFile(const HostResource& font_file,
+                                    ppapi::HostResource* result);
+  void OnMsgGetFontTableForPrivateFontFile(const ppapi::HostResource& font_file,
                                            uint32_t table,
                                            std::string* result);
 };
diff --git a/ppapi/proxy/ppb_surface_3d_proxy.cc b/ppapi/proxy/ppb_surface_3d_proxy.cc
index e522155..28577d76 100644
--- a/ppapi/proxy/ppb_surface_3d_proxy.cc
+++ b/ppapi/proxy/ppb_surface_3d_proxy.cc
@@ -17,6 +17,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_Surface3D_API;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/ppb_surface_3d_proxy.h b/ppapi/proxy/ppb_surface_3d_proxy.h
index f44ad76..0fa0d4c 100644
--- a/ppapi/proxy/ppb_surface_3d_proxy.h
+++ b/ppapi/proxy/ppb_surface_3d_proxy.h
@@ -26,7 +26,7 @@
 class Surface3D : public PluginResource,
                   public ppapi::thunk::PPB_Surface3D_API {
  public:
-  explicit Surface3D(const HostResource& host_resource);
+  explicit Surface3D(const ppapi::HostResource& host_resource);
   virtual ~Surface3D();
 
   // ResourceObjectBase overrides.
@@ -84,13 +84,14 @@
   void OnMsgCreate(PP_Instance instance,
                    PP_Config3D_Dev config,
                    const std::vector<int32_t>& attribs,
-                   HostResource* result);
-  void OnMsgSwapBuffers(const HostResource& surface);
+                   ppapi::HostResource* result);
+  void OnMsgSwapBuffers(const ppapi::HostResource& surface);
   // Renderer->plugin message handlers.
-  void OnMsgSwapBuffersACK(const HostResource& surface, int32_t pp_error);
+  void OnMsgSwapBuffersACK(const ppapi::HostResource& surface,
+                           int32_t pp_error);
 
   void SendSwapBuffersACKToPlugin(int32_t result,
-                                  const HostResource& surface_3d);
+                                  const ppapi::HostResource& surface_3d);
 
   CompletionCallbackFactory<PPB_Surface3D_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index ab069b1..7a1f7fd 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -11,6 +11,8 @@
 #include "ppapi/proxy/plugin_resource_tracker.h"
 #include "ppapi/proxy/ppapi_messages.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppb_testing_proxy.h b/ppapi/proxy/ppb_testing_proxy.h
index 352a2ae..d105769 100644
--- a/ppapi/proxy/ppb_testing_proxy.h
+++ b/ppapi/proxy/ppb_testing_proxy.h
@@ -8,8 +8,8 @@
 #include "base/basictypes.h"
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PP_Point;
 struct PPB_Testing_Dev;
@@ -33,8 +33,8 @@
 
  private:
   // Message handlers.
-  void OnMsgReadImageData(const HostResource& device_context_2d,
-                          const HostResource& image,
+  void OnMsgReadImageData(const ppapi::HostResource& device_context_2d,
+                          const ppapi::HostResource& image,
                           const PP_Point& top_left,
                           PP_Bool* result);
   void OnMsgRunMessageLoop(PP_Instance instance);
diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc
index 70a3126..43997ea2 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.cc
+++ b/ppapi/proxy/ppb_url_loader_proxy.cc
@@ -32,6 +32,7 @@
 #include <sys/shm.h>
 #endif
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_URLLoader_API;
diff --git a/ppapi/proxy/ppb_url_loader_proxy.h b/ppapi/proxy/ppb_url_loader_proxy.h
index 0ff7b7e0..a42e492 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.h
+++ b/ppapi/proxy/ppb_url_loader_proxy.h
@@ -12,9 +12,9 @@
 #include "ppapi/c/pp_size.h"
 #include "ppapi/c/pp_var.h"
 #include "ppapi/cpp/completion_callback.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_URLLoader;
 struct PPB_URLLoaderTrusted;
@@ -39,7 +39,7 @@
   // function allows the proxy for DocumentLoad to create the correct plugin
   // proxied info for the given browser-supplied URLLoader resource ID.
   static PP_Resource TrackPluginResource(
-      const HostResource& url_loader_resource);
+      const ppapi::HostResource& url_loader_resource);
 
   const PPB_URLLoader* ppb_url_loader_target() const {
     return reinterpret_cast<const PPB_URLLoader*>(target_interface());
@@ -60,25 +60,25 @@
 
   // Plugin->renderer message handlers.
   void OnMsgCreate(PP_Instance instance,
-                   HostResource* result);
-  void OnMsgOpen(const HostResource& loader,
-                 const HostResource& request_info,
+                   ppapi::HostResource* result);
+  void OnMsgOpen(const ppapi::HostResource& loader,
+                 const ppapi::HostResource& request_info,
                  uint32_t serialized_callback);
-  void OnMsgFollowRedirect(const HostResource& loader,
+  void OnMsgFollowRedirect(const ppapi::HostResource& loader,
                            uint32_t serialized_callback);
-  void OnMsgGetResponseInfo(const HostResource& loader,
-                            HostResource* result);
-  void OnMsgReadResponseBody(const HostResource& loader,
+  void OnMsgGetResponseInfo(const ppapi::HostResource& loader,
+                            ppapi::HostResource* result);
+  void OnMsgReadResponseBody(const ppapi::HostResource& loader,
                              int32_t bytes_to_read);
-  void OnMsgFinishStreamingToFile(const HostResource& loader,
+  void OnMsgFinishStreamingToFile(const ppapi::HostResource& loader,
                                   uint32_t serialized_callback);
-  void OnMsgClose(const HostResource& loader);
-  void OnMsgGrantUniversalAccess(const HostResource& loader);
+  void OnMsgClose(const ppapi::HostResource& loader);
+  void OnMsgGrantUniversalAccess(const ppapi::HostResource& loader);
 
   // Renderer->plugin message handlers.
   void OnMsgUpdateProgress(
       const PPBURLLoader_UpdateProgress_Params& params);
-  void OnMsgReadResponseBodyAck(const HostResource& pp_resource,
+  void OnMsgReadResponseBodyAck(const ppapi::HostResource& pp_resource,
                                 int32_t result,
                                 const std::string& data);
 
diff --git a/ppapi/proxy/ppb_url_request_info_proxy.cc b/ppapi/proxy/ppb_url_request_info_proxy.cc
index e2b96cb..63a0b871 100644
--- a/ppapi/proxy/ppb_url_request_info_proxy.cc
+++ b/ppapi/proxy/ppb_url_request_info_proxy.cc
@@ -13,6 +13,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterFunctionNoLock;
 using ppapi::thunk::PPB_URLRequestInfo_API;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/ppb_url_request_info_proxy.h b/ppapi/proxy/ppb_url_request_info_proxy.h
index 5bfb4d4..b1df51d8 100644
--- a/ppapi/proxy/ppb_url_request_info_proxy.h
+++ b/ppapi/proxy/ppb_url_request_info_proxy.h
@@ -8,8 +8,8 @@
 #include "base/basictypes.h"
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_URLRequestInfo;
 
@@ -33,14 +33,14 @@
 
  private:
   // Message handlers.
-  void OnMsgCreate(PP_Instance instance, HostResource* result);
-  void OnMsgSetProperty(HostResource request,
+  void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result);
+  void OnMsgSetProperty(ppapi::HostResource request,
                         int32_t property,
                         SerializedVarReceiveInput value);
-  void OnMsgAppendDataToBody(HostResource request,
+  void OnMsgAppendDataToBody(ppapi::HostResource request,
                              const std::string& data);
-  void OnMsgAppendFileToBody(HostResource request,
-                             HostResource file_ref,
+  void OnMsgAppendFileToBody(ppapi::HostResource request,
+                             ppapi::HostResource file_ref,
                              int64_t start_offset,
                              int64_t number_of_bytes,
                              double expected_last_modified_time);
diff --git a/ppapi/proxy/ppb_url_response_info_proxy.cc b/ppapi/proxy/ppb_url_response_info_proxy.cc
index b9df466..f0bfaf20 100644
--- a/ppapi/proxy/ppb_url_response_info_proxy.cc
+++ b/ppapi/proxy/ppb_url_response_info_proxy.cc
@@ -15,6 +15,7 @@
 #include "ppapi/thunk/ppb_url_response_info_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::PPB_URLResponseInfo_API;
 
 namespace pp {
diff --git a/ppapi/proxy/ppb_url_response_info_proxy.h b/ppapi/proxy/ppb_url_response_info_proxy.h
index ed6fb436..f181dfd 100644
--- a/ppapi/proxy/ppb_url_response_info_proxy.h
+++ b/ppapi/proxy/ppb_url_response_info_proxy.h
@@ -9,8 +9,8 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_module.h"
 #include "ppapi/c/pp_resource.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PPB_URLResponseInfo;
 
@@ -33,17 +33,18 @@
   // HostResource representing a response info to a properly tracked
   // URLReponseInfo PluginResource. Returns the plugin resource ID for the
   // new resource.
-  static PP_Resource CreateResponseForResource(const HostResource& resource);
+  static PP_Resource CreateResponseForResource(
+      const ppapi::HostResource& resource);
 
   // InterfaceProxy implementation.
   virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
-  void OnMsgGetProperty(const HostResource& response,
+  void OnMsgGetProperty(const ppapi::HostResource& response,
                         int32_t property,
                         SerializedVarReturnValue result);
-  void OnMsgGetBodyAsFileRef(const HostResource& response,
+  void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response,
                              PPBFileRef_CreateInfo* result);
 
   DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy);
diff --git a/ppapi/proxy/ppb_video_capture_proxy.cc b/ppapi/proxy/ppb_video_capture_proxy.cc
index 7c5c8a0a..56a99e5c 100644
--- a/ppapi/proxy/ppb_video_capture_proxy.cc
+++ b/ppapi/proxy/ppb_video_capture_proxy.cc
@@ -24,6 +24,7 @@
 #include "ppapi/thunk/ppb_video_capture_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Buffer_API;
 using ppapi::thunk::PPB_BufferTrusted_API;
diff --git a/ppapi/proxy/ppb_video_capture_proxy.h b/ppapi/proxy/ppb_video_capture_proxy.h
index 34b6536..c324cd9 100644
--- a/ppapi/proxy/ppb_video_capture_proxy.h
+++ b/ppapi/proxy/ppb_video_capture_proxy.h
@@ -13,11 +13,13 @@
 struct PPP_VideoCapture_Dev;
 struct PP_VideoCaptureDeviceInfo_Dev;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
-
 class PPB_VideoCapture_Proxy : public InterfaceProxy {
  public:
   PPB_VideoCapture_Proxy(Dispatcher* dispatcher, const void* target_interface);
@@ -36,13 +38,13 @@
 
  private:
   // Message handlers.
-  void OnMsgCreate(PP_Instance instance, HostResource* result_resource);
-  void OnMsgStartCapture(const HostResource& resource,
+  void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource);
+  void OnMsgStartCapture(const ppapi::HostResource& resource,
                          const PP_VideoCaptureDeviceInfo_Dev& info,
                          uint32_t buffers);
-  void OnMsgReuseBuffer(const HostResource& resource,
+  void OnMsgReuseBuffer(const ppapi::HostResource& resource,
                         uint32_t buffer);
-  void OnMsgStopCapture(const HostResource& resource);
+  void OnMsgStopCapture(const ppapi::HostResource& resource);
 };
 
 class PPP_VideoCapture_Proxy : public InterfaceProxy {
@@ -61,14 +63,14 @@
 
  private:
   // Message handlers.
-  void OnMsgOnDeviceInfo(const HostResource& video_capture,
+  void OnMsgOnDeviceInfo(const ppapi::HostResource& video_capture,
                          const PP_VideoCaptureDeviceInfo_Dev& info,
                          const std::vector<PPPVideoCapture_Buffer>& buffers);
-  void OnMsgOnStatus(const HostResource& video_capture,
+  void OnMsgOnStatus(const ppapi::HostResource& video_capture,
                      uint32_t status);
-  void OnMsgOnError(const HostResource& video_capture,
+  void OnMsgOnError(const ppapi::HostResource& video_capture,
                     uint32_t error_code);
-  void OnMsgOnBufferReady(const HostResource& video_capture,
+  void OnMsgOnBufferReady(const ppapi::HostResource& video_capture,
                           uint32_t buffer);
 };
 
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.cc b/ppapi/proxy/ppb_video_decoder_proxy.cc
index ddeeabd..85f6bff 100644
--- a/ppapi/proxy/ppb_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppb_video_decoder_proxy.cc
@@ -15,6 +15,7 @@
 #include "ppapi/thunk/resource_creation_api.h"
 #include "ppapi/thunk/thunk.h"
 
+using ppapi::HostResource;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Buffer_API;
 using ppapi::thunk::PPB_Context3D_API;
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.h b/ppapi/proxy/ppb_video_decoder_proxy.h
index 134fec75..e7c0457 100644
--- a/ppapi/proxy/ppb_video_decoder_proxy.h
+++ b/ppapi/proxy/ppb_video_decoder_proxy.h
@@ -37,37 +37,38 @@
  private:
   // Message handlers in the renderer process to receive messages from the
   // plugin process.
-  void OnMsgCreate(PP_Instance instance, const HostResource& context3d_id,
+  void OnMsgCreate(PP_Instance instance,
+                   const ppapi::HostResource& context3d_id,
                    const std::vector<PP_VideoConfigElement>& config,
-                   HostResource* result);
+                   ppapi::HostResource* result);
   void OnMsgDecode(
-      const HostResource& decoder,
-      const HostResource& buffer, int32 id, int32 size);
+      const ppapi::HostResource& decoder,
+      const ppapi::HostResource& buffer, int32 id, int32 size);
   void OnMsgAssignPictureBuffers(
-      const HostResource& decoder,
+      const ppapi::HostResource& decoder,
       const std::vector<PP_PictureBuffer_Dev>& buffers);
   void OnMsgReusePictureBuffer(
-      const HostResource& decoder,
+      const ppapi::HostResource& decoder,
       int32 picture_buffer_id);
-  void OnMsgFlush(const HostResource& decoder);
-  void OnMsgReset(const HostResource& decoder);
-  void OnMsgDestroy(const HostResource& decoder);
+  void OnMsgFlush(const ppapi::HostResource& decoder);
+  void OnMsgReset(const ppapi::HostResource& decoder);
+  void OnMsgDestroy(const ppapi::HostResource& decoder);
 
   // Send a message from the renderer process to the plugin process to tell it
   // to run its callback.
   void SendMsgEndOfBitstreamACKToPlugin(
-      int32_t result, const HostResource& decoder, int32 id);
+      int32_t result, const ppapi::HostResource& decoder, int32 id);
   void SendMsgFlushACKToPlugin(
-      int32_t result, const HostResource& decoder);
+      int32_t result, const ppapi::HostResource& decoder);
   void SendMsgResetACKToPlugin(
-      int32_t result, const HostResource& decoder);
+      int32_t result, const ppapi::HostResource& decoder);
 
   // Message handlers in the plugin process to receive messages from the
   // renderer process.
-  void OnMsgEndOfBitstreamACK(const HostResource& decoder,
+  void OnMsgEndOfBitstreamACK(const ppapi::HostResource& decoder,
                               int32_t id, int32_t result);
-  void OnMsgFlushACK(const HostResource& decoder, int32_t result);
-  void OnMsgResetACK(const HostResource& decoder, int32_t result);
+  void OnMsgFlushACK(const ppapi::HostResource& decoder, int32_t result);
+  void OnMsgResetACK(const ppapi::HostResource& decoder, int32_t result);
 
   CompletionCallbackFactory<PPB_VideoDecoder_Proxy,
                             ProxyNonThreadSafeRefCount> callback_factory_;
diff --git a/ppapi/proxy/ppp_graphics_3d_proxy.h b/ppapi/proxy/ppp_graphics_3d_proxy.h
index 41c400a..b52a500 100644
--- a/ppapi/proxy/ppp_graphics_3d_proxy.h
+++ b/ppapi/proxy/ppp_graphics_3d_proxy.h
@@ -6,7 +6,6 @@
 #define PPAPI_PROXY_PPP_GRAPHICS_3D_PROXY_H_
 
 #include "ppapi/c/pp_instance.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 
 struct PPP_Graphics3D_Dev;
diff --git a/ppapi/proxy/ppp_instance_private_proxy.h b/ppapi/proxy/ppp_instance_private_proxy.h
index 1df2e44..166ee7d 100644
--- a/ppapi/proxy/ppp_instance_private_proxy.h
+++ b/ppapi/proxy/ppp_instance_private_proxy.h
@@ -8,7 +8,6 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/pp_var.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
 
 struct PPP_Instance_Private;
diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc
index cc2f9db..05c061be 100644
--- a/ppapi/proxy/ppp_instance_proxy.cc
+++ b/ppapi/proxy/ppp_instance_proxy.cc
@@ -16,6 +16,8 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppb_url_loader_proxy.h"
 
+using ppapi::HostResource;
+
 namespace pp {
 namespace proxy {
 
diff --git a/ppapi/proxy/ppp_instance_proxy.h b/ppapi/proxy/ppp_instance_proxy.h
index b246c5c..1ff2f8b 100644
--- a/ppapi/proxy/ppp_instance_proxy.h
+++ b/ppapi/proxy/ppp_instance_proxy.h
@@ -12,8 +12,8 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/pp_var.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/ppp_instance_combined.h"
 
 struct PP_Rect;
@@ -57,7 +57,7 @@
                           PP_Bool fullscreen);
   void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus);
   void OnMsgHandleDocumentLoad(PP_Instance instance,
-                               const HostResource& url_loader,
+                               const ppapi::HostResource& url_loader,
                                PP_Bool* result);
   scoped_ptr< ::ppapi::PPP_Instance_Combined> combined_interface_;
 };
diff --git a/ppapi/proxy/ppp_video_decoder_proxy.cc b/ppapi/proxy/ppp_video_decoder_proxy.cc
index cae7c23..d4eaed1 100644
--- a/ppapi/proxy/ppp_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppp_video_decoder_proxy.cc
@@ -11,7 +11,8 @@
 #include "ppapi/thunk/ppb_video_decoder_api.h"
 #include "ppapi/thunk/thunk.h"
 
-using ::ppapi::thunk::PPB_VideoDecoder_API;
+using ppapi::HostResource;
+using ppapi::thunk::PPB_VideoDecoder_API;
 
 namespace pp {
 namespace proxy {
diff --git a/ppapi/proxy/ppp_video_decoder_proxy.h b/ppapi/proxy/ppp_video_decoder_proxy.h
index c211a89..9e3eab6 100644
--- a/ppapi/proxy/ppp_video_decoder_proxy.h
+++ b/ppapi/proxy/ppp_video_decoder_proxy.h
@@ -7,8 +7,8 @@
 
 #include "ppapi/c/dev/ppp_video_decoder_dev.h"
 #include "ppapi/c/pp_instance.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PP_Picture_Dev;
 struct PP_Size;
@@ -32,15 +32,15 @@
 
  private:
   // Message handlers.
-  void OnMsgProvidePictureBuffers(const HostResource& decoder,
+  void OnMsgProvidePictureBuffers(const ppapi::HostResource& decoder,
                                   uint32_t req_num_of_buffers,
                                   const PP_Size& dimensions);
-  void OnMsgDismissPictureBuffer(const HostResource& decoder,
+  void OnMsgDismissPictureBuffer(const ppapi::HostResource& decoder,
                                  int32_t picture_id);
-  void OnMsgPictureReady(
-      const HostResource& decoder, const PP_Picture_Dev& picture_buffer);
-  void OnMsgNotifyEndOfStream(const HostResource& decoder);
-  void OnMsgNotifyError(const HostResource& decoder,
+  void OnMsgPictureReady(const ppapi::HostResource& decoder,
+                         const PP_Picture_Dev& picture_buffer);
+  void OnMsgNotifyEndOfStream(const ppapi::HostResource& decoder);
+  void OnMsgNotifyError(const ppapi::HostResource& decoder,
                         PP_VideoDecodeError_Dev error);
 
   DISALLOW_COPY_AND_ASSIGN(PPP_VideoDecoder_Proxy);
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index 596f7a5..fc4a48c 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -6,7 +6,6 @@
 
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/c/pp_size.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/interface_id.h"
 #include "ppapi/proxy/plugin_dispatcher.h"
 #include "ppapi/c/trusted/ppb_image_data_trusted.h"
@@ -35,11 +34,13 @@
 #include "ppapi/proxy/ppb_video_decoder_proxy.h"
 #include "ppapi/shared_impl/font_impl.h"
 #include "ppapi/shared_impl/function_group_base.h"
+#include "ppapi/shared_impl/host_resource.h"
 #include "ppapi/shared_impl/input_event_impl.h"
 #include "ppapi/shared_impl/var.h"
 #include "ppapi/thunk/enter.h"
 #include "ppapi/thunk/ppb_image_data_api.h"
 
+using ppapi::HostResource;
 using ppapi::InputEventData;
 using ppapi::StringVar;
 using ppapi::thunk::ResourceCreationAPI;
diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h
index 7a91884..2dacd6c 100644
--- a/ppapi/proxy/resource_creation_proxy.h
+++ b/ppapi/proxy/resource_creation_proxy.h
@@ -17,10 +17,13 @@
 
 struct PP_Size;
 
+namespace ppapi {
+class HostResource;
+}
+
 namespace pp {
 namespace proxy {
 
-class HostResource;
 class Dispatcher;
 
 class ResourceCreationProxy : public ::ppapi::FunctionGroupBase,
@@ -132,16 +135,16 @@
   void OnMsgCreateAudio(PP_Instance instance,
                         int32_t sample_rate,
                         uint32_t sample_frame_count,
-                        HostResource* result);
+                        ppapi::HostResource* result);
   void OnMsgCreateGraphics2D(PP_Instance instance,
                              const PP_Size& size,
                              PP_Bool is_always_opaque,
-                             HostResource* result);
+                             ppapi::HostResource* result);
   void OnMsgCreateImageData(PP_Instance instance,
                             int32_t format,
                             const PP_Size& size,
                             PP_Bool init_to_zero,
-                            HostResource* result,
+                            ppapi::HostResource* result,
                             std::string* image_data_desc,
                             ImageHandle* result_image_handle);
 
diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h
index dd833963..dac6540 100644
--- a/ppapi/proxy/serialized_structs.h
+++ b/ppapi/proxy/serialized_structs.h
@@ -15,8 +15,8 @@
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_point.h"
 #include "ppapi/c/pp_rect.h"
-#include "ppapi/proxy/host_resource.h"
 #include "ppapi/proxy/serialized_var.h"
+#include "ppapi/shared_impl/host_resource.h"
 
 struct PP_FontDescription_Dev;
 
@@ -75,7 +75,7 @@
 struct PPBFileRef_CreateInfo {
   PPBFileRef_CreateInfo();  // Initializes to 0.
 
-  HostResource resource;
+  ppapi::HostResource resource;
   int file_system_type;  // One of PP_FileSystemType values.
   SerializedVar path;
   SerializedVar name;
@@ -86,7 +86,7 @@
   ~PPBFlash_DrawGlyphs_Params();
 
   PP_Instance instance;
-  HostResource image_data;
+  ppapi::HostResource image_data;
   SerializedFontDescription font_desc;
   uint32_t color;
   PP_Point position;
@@ -97,7 +97,7 @@
 };
 
 struct PPBAudio_NotifyAudioStreamCreated_Params {
-  pp::proxy::HostResource audio_id;
+  ppapi::HostResource audio_id;
   int32_t result_code;  // Will be != PP_OK on failure
   IPC::PlatformFileForTransit socket_handle;
   base::SharedMemoryHandle handle;
@@ -106,7 +106,7 @@
 
 struct PPBURLLoader_UpdateProgress_Params {
   PP_Instance instance;
-  pp::proxy::HostResource resource;
+  ppapi::HostResource resource;
   int64_t bytes_sent;
   int64_t total_bytes_to_be_sent;
   int64_t bytes_received;
@@ -114,7 +114,7 @@
 };
 
 struct PPPVideoCapture_Buffer {
-  pp::proxy::HostResource resource;
+  ppapi::HostResource resource;
   uint32_t size;
   base::SharedMemoryHandle handle;
 };
diff --git a/ppapi/proxy/host_resource.h b/ppapi/shared_impl/host_resource.h
similarity index 91%
rename from ppapi/proxy/host_resource.h
rename to ppapi/shared_impl/host_resource.h
index fe1abb2..0d9b3bf0 100644
--- a/ppapi/proxy/host_resource.h
+++ b/ppapi/shared_impl/host_resource.h
@@ -2,14 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef PPAPI_PROXY_HOST_RESOURCE_H_
-#define PPAPI_PROXY_HOST_RESOURCE_H_
+#ifndef PPAPI_SHARED_IMPL_HOST_RESOURCE_H_
+#define PPAPI_SHARED_IMPL_HOST_RESOURCE_H_
 
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/c/pp_resource.h"
 
-namespace pp {
-namespace proxy {
+namespace ppapi {
 
 // Represents a PP_Resource sent over the wire. This just wraps a PP_Resource.
 // The point is to prevent mistakes where the wrong resource value is sent.
@@ -64,7 +63,6 @@
   PP_Resource host_resource_;
 };
 
-}  // namespace proxy
-}  // namespace pp
+}  // namespace ppapi
 
-#endif  // PPAPI_PROXY_HOST_RESOURCE_H_
+#endif  // PPAPI_SHARED_IMPL_HOST_RESOURCE_H_