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

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

Issue 9015009: Use the new callback tracker and delete the old one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years 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: webkit/plugins/ppapi/ppb_file_chooser_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc b/webkit/plugins/ppapi/ppb_file_chooser_impl.cc
index 1a5167bd9ce97c9e395931c8c142b439500b303d..e08b4d4bddc29d2286576add658d62efbe80153d 100644
--- a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_chooser_impl.cc
@@ -13,6 +13,7 @@
#include "base/sys_string_conversions.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/shared_impl/var.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h"
@@ -20,7 +21,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
#include "webkit/glue/webkit_glue.h"
-#include "webkit/plugins/ppapi/callbacks.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
@@ -30,6 +30,7 @@
using ppapi::StringVar;
using ppapi::thunk::PPB_FileChooser_API;
+using ppapi::TrackedCallback;
using WebKit::WebCString;
using WebKit::WebFileChooserCompletion;
using WebKit::WebFileChooserParams;
@@ -138,14 +139,11 @@ void PPB_FileChooser_Impl::RegisterCallback(
if (!plugin_module)
return;
- callback_ = new TrackedCompletionCallback(plugin_module->GetCallbackTracker(),
- pp_resource(), callback);
+ callback_ = new TrackedCallback(this, callback);
}
void PPB_FileChooser_Impl::RunCallback(int32_t result) {
- scoped_refptr<TrackedCompletionCallback> callback;
- callback.swap(callback_);
- callback->Run(result); // Will complete abortively if necessary.
+ TrackedCallback::ClearAndRun(&callback_, result);
}
int32_t PPB_FileChooser_Impl::Show(const PP_CompletionCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698