| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/thunk/enter.h" | 5 #include "ppapi/thunk/enter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 EnterInstance::EnterInstance(PP_Instance instance) | 215 EnterInstance::EnterInstance(PP_Instance instance) |
| 216 : EnterBase(), | 216 : EnterBase(), |
| 217 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { | 217 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { |
| 218 SetStateForFunctionError(instance, functions_, true); | 218 SetStateForFunctionError(instance, functions_, true); |
| 219 } | 219 } |
| 220 | 220 |
| 221 EnterInstance::EnterInstance(PP_Instance instance, | 221 EnterInstance::EnterInstance(PP_Instance instance, |
| 222 const PP_CompletionCallback& callback) | 222 const PP_CompletionCallback& callback) |
| 223 : EnterBase(0 /* resource */, callback), | 223 : EnterBase(0 /* resource */, callback), |
| 224 // TODO(dmichael): This means that the callback_ we get is not associated | 224 // TODO(dmichael): This means that the callback_ we get is not associated |
| 225 // even with the instance, but we should handle that for | 225 // even with the instance, but we should handle that for |
| 226 // MouseLock (maybe others?). | 226 // MouseLock (maybe others?). |
| 227 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { | 227 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { |
| 228 SetStateForFunctionError(instance, functions_, true); | 228 SetStateForFunctionError(instance, functions_, true); |
| 229 } | 229 } |
| 230 | 230 |
| 231 EnterInstance::~EnterInstance() { | 231 EnterInstance::~EnterInstance() { |
| 232 } | 232 } |
| 233 | 233 |
| 234 EnterInstanceNoLock::EnterInstanceNoLock(PP_Instance instance) | 234 EnterInstanceNoLock::EnterInstanceNoLock(PP_Instance instance) |
| 235 : EnterBase(), | 235 : EnterBase(), |
| 236 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { | 236 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { |
| 237 SetStateForFunctionError(instance, functions_, true); | 237 SetStateForFunctionError(instance, functions_, true); |
| 238 } | 238 } |
| 239 | 239 |
| 240 EnterInstanceNoLock::EnterInstanceNoLock( |
| 241 PP_Instance instance, |
| 242 const PP_CompletionCallback& callback) |
| 243 : EnterBase(0 /* resource */, callback), |
| 244 // TODO(dmichael): This means that the callback_ we get is not associated |
| 245 // even with the instance, but we should handle that for |
| 246 // MouseLock (maybe others?). |
| 247 functions_(PpapiGlobals::Get()->GetInstanceAPI(instance)) { |
| 248 SetStateForFunctionError(instance, functions_, true); |
| 249 } |
| 250 |
| 240 EnterInstanceNoLock::~EnterInstanceNoLock() { | 251 EnterInstanceNoLock::~EnterInstanceNoLock() { |
| 241 } | 252 } |
| 242 | 253 |
| 243 EnterResourceCreation::EnterResourceCreation(PP_Instance instance) | 254 EnterResourceCreation::EnterResourceCreation(PP_Instance instance) |
| 244 : EnterBase(), | 255 : EnterBase(), |
| 245 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { | 256 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { |
| 246 SetStateForFunctionError(instance, functions_, true); | 257 SetStateForFunctionError(instance, functions_, true); |
| 247 } | 258 } |
| 248 | 259 |
| 249 EnterResourceCreation::~EnterResourceCreation() { | 260 EnterResourceCreation::~EnterResourceCreation() { |
| 250 } | 261 } |
| 251 | 262 |
| 252 EnterResourceCreationNoLock::EnterResourceCreationNoLock(PP_Instance instance) | 263 EnterResourceCreationNoLock::EnterResourceCreationNoLock(PP_Instance instance) |
| 253 : EnterBase(), | 264 : EnterBase(), |
| 254 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { | 265 functions_(PpapiGlobals::Get()->GetResourceCreationAPI(instance)) { |
| 255 SetStateForFunctionError(instance, functions_, true); | 266 SetStateForFunctionError(instance, functions_, true); |
| 256 } | 267 } |
| 257 | 268 |
| 258 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() { | 269 EnterResourceCreationNoLock::~EnterResourceCreationNoLock() { |
| 259 } | 270 } |
| 260 | 271 |
| 261 } // namespace thunk | 272 } // namespace thunk |
| 262 } // namespace ppapi | 273 } // namespace ppapi |
| OLD | NEW |