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

Unified Diff: webkit/plugins/ppapi/ppb_broker_impl.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export AssertLockHeld Created 8 years, 6 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
« no previous file with comments | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | webkit/plugins/ppapi/ppb_directory_reader_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_broker_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_broker_impl.cc b/webkit/plugins/ppapi/ppb_broker_impl.cc
index 289b17316c1ba4f1ecbc0fa36297003ce9d186a9..2386e0dcec87288038dee8e875911a8fdb7074db 100644
--- a/webkit/plugins/ppapi/ppb_broker_impl.cc
+++ b/webkit/plugins/ppapi/ppb_broker_impl.cc
@@ -40,12 +40,8 @@ PPB_Broker_API* PPB_Broker_Impl::AsPPB_Broker_API() {
return this;
}
-int32_t PPB_Broker_Impl::Connect(PP_CompletionCallback connect_callback) {
- if (!connect_callback.func) {
- // Synchronous calls are not supported.
- return PP_ERROR_BLOCKS_MAIN_THREAD;
- }
-
+int32_t PPB_Broker_Impl::Connect(
+ scoped_refptr<TrackedCallback> connect_callback) {
// TODO(ddorwin): Return PP_ERROR_FAILED if plugin is in-process.
if (broker_) {
@@ -61,7 +57,7 @@ int32_t PPB_Broker_Impl::Connect(PP_CompletionCallback connect_callback) {
// and BrokerConnected is called before ConnectToBroker returns.
// Because it must be created now, it must be aborted and cleared if
// ConnectToBroker fails.
- connect_callback_ = new TrackedCallback(this, connect_callback);
+ connect_callback_ = connect_callback;
broker_ = plugin_instance->delegate()->ConnectToBroker(this);
if (!broker_) {
« no previous file with comments | « webkit/plugins/ppapi/ppb_broker_impl.h ('k') | webkit/plugins/ppapi/ppb_directory_reader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698