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

Side by Side Diff: webkit/plugins/ppapi/host_globals.cc

Issue 9006055: Move the tracked completion callback code into shared impl. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
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 #include "webkit/plugins/ppapi/host_globals.h" 5 #include "webkit/plugins/ppapi/host_globals.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 ::ppapi::ResourceTracker* HostGlobals::GetResourceTracker() { 53 ::ppapi::ResourceTracker* HostGlobals::GetResourceTracker() {
54 return &host_resource_tracker_; 54 return &host_resource_tracker_;
55 } 55 }
56 56
57 ::ppapi::VarTracker* HostGlobals::GetVarTracker() { 57 ::ppapi::VarTracker* HostGlobals::GetVarTracker() {
58 return &host_var_tracker_; 58 return &host_var_tracker_;
59 } 59 }
60 60
61 ::ppapi::CallbackTracker* HostGlobals::GetCallbackTrackerForInstance(
62 PP_Instance instance) {
63 std::map<PP_Instance, linked_ptr<InstanceData> >::iterator found =
64 instance_map_.find(instance);
65 if (found == instance_map_.end())
66 return NULL;
67
68 return found->second->instance->module()->GetNewCallbackTracker();
69 }
70
61 ::ppapi::FunctionGroupBase* HostGlobals::GetFunctionAPI(PP_Instance pp_instance, 71 ::ppapi::FunctionGroupBase* HostGlobals::GetFunctionAPI(PP_Instance pp_instance,
62 ::ppapi::ApiID id) { 72 ::ppapi::ApiID id) {
63 // Get the instance object. This also ensures that the instance data is in 73 // Get the instance object. This also ensures that the instance data is in
64 // the map, since we need it below. 74 // the map, since we need it below.
65 PluginInstance* instance = GetInstance(pp_instance); 75 PluginInstance* instance = GetInstance(pp_instance);
66 if (!instance) 76 if (!instance)
67 return NULL; 77 return NULL;
68 78
69 // The instance one is special, since it's just implemented by the instance 79 // The instance one is special, since it's just implemented by the instance
70 // object. 80 // object.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE)) 192 DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE))
183 << instance << " is not a PP_Instance."; 193 << instance << " is not a PP_Instance.";
184 InstanceMap::iterator found = instance_map_.find(instance); 194 InstanceMap::iterator found = instance_map_.find(instance);
185 if (found == instance_map_.end()) 195 if (found == instance_map_.end())
186 return NULL; 196 return NULL;
187 return found->second->instance; 197 return found->second->instance;
188 } 198 }
189 199
190 } // namespace ppapi 200 } // namespace ppapi
191 } // namespace webkit 201 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698