forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert more interfaces to the new thunk system. This goes up to and …
…including the ones starting with "F". Since this adds a lot more interfaces, I added the macro stuff we used for the old system to generate the various template specializations. This involded a lot of renaming since the As* needs to match the name (I was previously leaving off the "PPB_" part). I did other misc cleanup to the infrastructure. Review URL: http://codereview.chromium.org/7082036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87415 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
brettw@chromium.org
committed
Jun 1, 2011
1 parent
d0922ea
commit 1598e4a
Showing
86 changed files
with
1,857 additions
and
1,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) 2011 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef PPAPI_PROXY_ENTER_PROXY_H_ | ||
#define PPAPI_PROXY_ENTER_PROXY_H_ | ||
|
||
#include "base/logging.h" | ||
#include "ppapi/proxy/host_dispatcher.h" | ||
#include "ppapi/proxy/plugin_dispatcher.h" | ||
#include "ppapi/proxy/plugin_resource_tracker.h" | ||
#include "ppapi/thunk/enter.h" | ||
|
||
namespace pp { | ||
namespace proxy { | ||
|
||
// Wrapper around EnterResourceNoLock that takes a host resource. This is used | ||
// when handling messages in the plugin from the host and we need to convert to | ||
// an object in the plugin side corresponding to that. | ||
// | ||
// This never locks since we assume the host Resource is coming from IPC, and | ||
// never logs errors since we assume the host is doing reasonable things. | ||
template<typename ResourceT> | ||
class EnterPluginFromHostResource | ||
: public ::ppapi::thunk::EnterResourceNoLock<ResourceT> { | ||
public: | ||
EnterPluginFromHostResource(const HostResource& host_resource) | ||
: ::ppapi::thunk::EnterResourceNoLock<ResourceT>( | ||
PluginResourceTracker::GetInstance()->PluginResourceForHostResource( | ||
host_resource), | ||
false) { | ||
// Validate that we're in the plugin rather than the host. Otherwise this | ||
// object will do the wrong thing. In the plugin, the instance should have | ||
// a corresponding plugin dispatcher (assuming the resource is valid). | ||
DCHECK(this->failed() || | ||
PluginDispatcher::GetForInstance(host_resource.instance())); | ||
} | ||
}; | ||
|
||
template<typename ResourceT> | ||
class EnterHostFromHostResource | ||
: public ::ppapi::thunk::EnterResourceNoLock<ResourceT> { | ||
public: | ||
EnterHostFromHostResource(const 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 | ||
// object will do the wrong thing. In the host, the instance should have | ||
// a corresponding host disptacher (assuming the resource is valid). | ||
DCHECK(this->failed() || | ||
HostDispatcher::GetForInstance(host_resource.instance())); | ||
} | ||
}; | ||
|
||
} // namespace proxy | ||
} // namespace pp | ||
|
||
#endif // PPAPI_PROXY_ENTER_PROXY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.