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

Unified Diff: ppapi/thunk/enter.cc

Issue 9113044: Convert to new enter method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove common.h 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/enter.cc
diff --git a/ppapi/thunk/enter.cc b/ppapi/thunk/enter.cc
index 43e80fefd9380624241cb3f72ff8c0adcc219acd..2b0057181e11f6d30a87999ce61f1bda2d78194b 100644
--- a/ppapi/thunk/enter.cc
+++ b/ppapi/thunk/enter.cc
@@ -104,6 +104,26 @@ void EnterBase::SetStateForResourceError(PP_Resource pp_resource,
}
}
+void EnterBase::SetStateForFunctionError(PP_Instance pp_instance,
+ void* object,
+ bool report_error) {
+ if (object)
+ return; // Everything worked.
+
+ retval_ = PP_ERROR_BADARGUMENT;
+
+ // We choose to silently ignore the error when the pp_instance is null as
+ // for PP_Resources above.
+ if (report_error && pp_instance) {
+ std::string message;
+ message = base::StringPrintf(
+ "0x%X is not a valid instance ID.",
+ pp_instance);
+ PpapiGlobals::Get()->BroadcastLogWithSource(0, PP_LOGLEVEL_ERROR,
+ std::string(), message);
+ }
+}
+
} // namespace subtle
EnterResourceCreation::EnterResourceCreation(PP_Instance instance)
@@ -114,7 +134,12 @@ EnterResourceCreation::~EnterResourceCreation() {
}
EnterInstance::EnterInstance(PP_Instance instance)
- : EnterFunctionNoLock<PPB_Instance_FunctionAPI>(instance, true) {
+ : EnterFunction<PPB_Instance_FunctionAPI>(instance, true) {
+}
+
+EnterInstance::EnterInstance(PP_Instance instance,
+ const PP_CompletionCallback& callback)
+ : EnterFunction<PPB_Instance_FunctionAPI>(instance, callback, true) {
}
EnterInstance::~EnterInstance() {

Powered by Google App Engine
This is Rietveld 408576698