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

Side by Side Diff: ppapi/proxy/enter_proxy.h

Issue 8344025: Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/plugin_globals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_PROXY_ENTER_PROXY_H_ 5 #ifndef PPAPI_PROXY_ENTER_PROXY_H_
6 #define PPAPI_PROXY_ENTER_PROXY_H_ 6 #define PPAPI_PROXY_ENTER_PROXY_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ppapi/cpp/completion_callback.h" 9 #include "ppapi/cpp/completion_callback.h"
10 #include "ppapi/proxy/host_dispatcher.h" 10 #include "ppapi/proxy/host_dispatcher.h"
11 #include "ppapi/proxy/plugin_dispatcher.h" 11 #include "ppapi/proxy/plugin_dispatcher.h"
12 #include "ppapi/proxy/plugin_globals.h"
12 #include "ppapi/proxy/plugin_resource_tracker.h" 13 #include "ppapi/proxy/plugin_resource_tracker.h"
13 #include "ppapi/thunk/enter.h" 14 #include "ppapi/thunk/enter.h"
14 15
15 namespace ppapi { 16 namespace ppapi {
16 17
17 namespace thunk { 18 namespace thunk {
18 class ResourceCreationAPI; 19 class ResourceCreationAPI;
19 } 20 }
20 21
21 namespace proxy { 22 namespace proxy {
22 23
23 // Wrapper around EnterResourceNoLock that takes a host resource. This is used 24 // Wrapper around EnterResourceNoLock that takes a host resource. This is used
24 // when handling messages in the plugin from the host and we need to convert to 25 // when handling messages in the plugin from the host and we need to convert to
25 // an object in the plugin side corresponding to that. 26 // an object in the plugin side corresponding to that.
26 // 27 //
27 // This never locks since we assume the host Resource is coming from IPC, and 28 // This never locks since we assume the host Resource is coming from IPC, and
28 // never logs errors since we assume the host is doing reasonable things. 29 // never logs errors since we assume the host is doing reasonable things.
29 template<typename ResourceT> 30 template<typename ResourceT>
30 class EnterPluginFromHostResource 31 class EnterPluginFromHostResource
31 : public thunk::EnterResourceNoLock<ResourceT> { 32 : public thunk::EnterResourceNoLock<ResourceT> {
32 public: 33 public:
33 EnterPluginFromHostResource(const HostResource& host_resource) 34 EnterPluginFromHostResource(const HostResource& host_resource)
34 : thunk::EnterResourceNoLock<ResourceT>( 35 : thunk::EnterResourceNoLock<ResourceT>(
35 PluginResourceTracker::GetInstance()->PluginResourceForHostResource( 36 PluginGlobals::Get()->plugin_resource_tracker()->
36 host_resource), 37 PluginResourceForHostResource(host_resource),
37 false) { 38 false) {
38 // Validate that we're in the plugin rather than the host. Otherwise this 39 // Validate that we're in the plugin rather than the host. Otherwise this
39 // object will do the wrong thing. In the plugin, the instance should have 40 // object will do the wrong thing. In the plugin, the instance should have
40 // a corresponding plugin dispatcher (assuming the resource is valid). 41 // a corresponding plugin dispatcher (assuming the resource is valid).
41 DCHECK(this->failed() || 42 DCHECK(this->failed() ||
42 PluginDispatcher::GetForInstance(host_resource.instance())); 43 PluginDispatcher::GetForInstance(host_resource.instance()));
43 } 44 }
44 }; 45 };
45 46
46 template<typename ResourceT> 47 template<typename ResourceT>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 163 }
163 164
164 bool needs_running_; 165 bool needs_running_;
165 pp::CompletionCallback callback_; 166 pp::CompletionCallback callback_;
166 }; 167 };
167 168
168 } // namespace proxy 169 } // namespace proxy
169 } // namespace ppapi 170 } // namespace ppapi
170 171
171 #endif // PPAPI_PROXY_ENTER_PROXY_H_ 172 #endif // PPAPI_PROXY_ENTER_PROXY_H_
OLDNEW
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/plugin_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698