summaryrefslogtreecommitdiffstats
path: root/ppapi/utility
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-10 01:01:10 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-10 01:01:10 +0000
commit232aabfca535b962d41aae13f08104292b40cbaa (patch)
tree5b0bb37f4262fc797b9b71c3011e4d5142c6ba1a /ppapi/utility
parent5d50b28df12016b7582497cd7282454622b52782 (diff)
downloadchromium_src-232aabfca535b962d41aae13f08104292b40cbaa.zip
chromium_src-232aabfca535b962d41aae13f08104292b40cbaa.tar.gz
chromium_src-232aabfca535b962d41aae13f08104292b40cbaa.tar.bz2
Remove NewRequiredCallback.
This is the same as NewCallback, and we want people to normally use the "required" type. So just having them call NewCallback is usually the right thing. This converts the existing callers to just say NewCallback. BUG= TEST= Review URL: http://codereview.chromium.org/9615050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/utility')
-rw-r--r--ppapi/utility/completion_callback_factory.h95
1 files changed, 2 insertions, 93 deletions
diff --git a/ppapi/utility/completion_callback_factory.h b/ppapi/utility/completion_callback_factory.h
index 98e15f1..e0b1f37 100644
--- a/ppapi/utility/completion_callback_factory.h
+++ b/ppapi/utility/completion_callback_factory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -39,7 +39,7 @@ namespace pp {
/// }
///
/// void ProcessFile(const FileRef& file) {
-/// CompletionCallback cc = factory_.NewRequiredCallback(
+/// CompletionCallback cc = factory_.NewCallback(
/// &MyHandler::DidOpen);
/// int32_t rv = fio_.Open(file, PP_FileOpenFlag_Read, cc);
/// CHECK(rv == PP_OK_COMPLETIONPENDING);
@@ -147,7 +147,6 @@ class CompletionCallbackFactory {
/// NewCallback allocates a new, single-use <code>CompletionCallback</code>.
/// The <code>CompletionCallback</code> must be run in order for the memory
/// allocated by the methods to be freed.
- /// NewCallback() is equivalent to NewRequiredCallback() below.
///
/// @param[in] method The method to be invoked upon completion of the
/// operation.
@@ -159,22 +158,6 @@ class CompletionCallbackFactory {
return NewCallbackHelper(Dispatcher0<Method>(method));
}
- /// NewRequiredCallback() allocates a new, single-use
- /// <code>CompletionCallback</code> that will always run. The
- /// <code>CompletionCallback</code> must be run in order for the memory
- /// allocated by the methods to be freed.
- ///
- /// @param[in] method The method to be invoked upon completion of the
- /// operation.
- ///
- /// @return A <code>CompletionCallback</code>.
- template <typename Method>
- CompletionCallback NewRequiredCallback(Method method) {
- CompletionCallback cc = NewCallback(method);
- cc.set_flags(cc.flags() & ~PP_COMPLETIONCALLBACK_FLAG_OPTIONAL);
- return cc;
- }
-
/// NewOptionalCallback() allocates a new, single-use
/// <code>CompletionCallback</code> that might not run if the method
/// taking it can complete synchronously. Thus, if after passing the
@@ -196,7 +179,6 @@ class CompletionCallbackFactory {
/// NewCallback() allocates a new, single-use <code>CompletionCallback</code>.
/// The <code>CompletionCallback</code> must be run in order for the memory
/// allocated by the methods to be freed.
- /// NewCallback() is equivalent to NewRequiredCallback() below.
///
/// @param[in] method The method to be invoked upon completion of the
/// operation. Method should be of type:
@@ -212,26 +194,6 @@ class CompletionCallbackFactory {
return NewCallbackHelper(Dispatcher1<Method, A>(method, a));
}
- /// NewRequiredCallback() allocates a new, single-use
- /// <code>CompletionCallback</code> that will always run. The
- /// <code>CompletionCallback</code> must be run in order for the memory
- /// allocated by the methods to be freed.
- ///
- /// @param[in] method The method to be invoked upon completion of the
- /// operation. Method should be of type:
- /// <code>void (T::*)(int32_t result, const A& a)</code>
- ///
- /// @param[in] a Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @return A <code>CompletionCallback</code>.
- template <typename Method, typename A>
- CompletionCallback NewRequiredCallback(Method method, const A& a) {
- CompletionCallback cc = NewCallback(method, a);
- cc.set_flags(cc.flags() & ~PP_COMPLETIONCALLBACK_FLAG_OPTIONAL);
- return cc;
- }
-
/// NewOptionalCallback() allocates a new, single-use
/// <code>CompletionCallback</code> that might not run if the method
/// taking it can complete synchronously. Thus, if after passing the
@@ -258,7 +220,6 @@ class CompletionCallbackFactory {
/// <code>CompletionCallback</code>.
/// The <code>CompletionCallback</code> must be run in order for the memory
/// allocated by the methods to be freed.
- /// NewCallback() is equivalent to NewRequiredCallback() below.
///
/// @param method The method taking the callback. Method should be of type:
/// <code>void (T::*)(int32_t result, const A& a, const B& b)</code>
@@ -276,29 +237,6 @@ class CompletionCallbackFactory {
return NewCallbackHelper(Dispatcher2<Method, A, B>(method, a, b));
}
- /// NewRequiredCallback() allocates a new, single-use
- /// <code>CompletionCallback</code> that will always run. The
- /// <code>CompletionCallback</code> must be run in order for the memory
- /// allocated by the methods to be freed.
- ///
- /// @param method The method taking the callback. Method should be of type:
- /// <code>void (T::*)(int32_t result, const A& a, const B& b)</code>
- ///
- /// @param[in] a Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @param[in] b Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @return A <code>CompletionCallback</code>.
- template <typename Method, typename A, typename B>
- CompletionCallback NewRequiredCallback(Method method, const A& a,
- const B& b) {
- CompletionCallback cc = NewCallback(method, a, b);
- cc.set_flags(cc.flags() & ~PP_COMPLETIONCALLBACK_FLAG_OPTIONAL);
- return cc;
- }
-
/// NewOptionalCallback() allocates a new, single-use
/// <code>CompletionCallback</code> that might not run if the method
/// taking it can complete synchronously. Thus, if after passing the
@@ -329,7 +267,6 @@ class CompletionCallbackFactory {
/// <code>CompletionCallback</code>.
/// The <code>CompletionCallback</code> must be run in order for the memory
/// allocated by the methods to be freed.
- /// NewCallback() is equivalent to NewRequiredCallback() below.
///
/// @param method The method taking the callback. Method should be of type:
/// <code>
@@ -353,34 +290,6 @@ class CompletionCallbackFactory {
return NewCallbackHelper(Dispatcher3<Method, A, B, C>(method, a, b, c));
}
- /// NewRequiredCallback() allocates a new, single-use
- /// <code>CompletionCallback</code> that will always run. The
- /// <code>CompletionCallback</code> must be run in order for the memory
- /// allocated by the methods to be freed.
- ///
- /// @param method The method taking the callback. Method should be of type:
- /// <code>
- /// void (T::*)(int32_t result, const A& a, const B& b, const C& c)
- /// </code>
- ///
- /// @param[in] a Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @param[in] b Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @param[in] c Passed to <code>method</code> when the completion callback
- /// runs.
- ///
- /// @return A <code>CompletionCallback</code>.
- template <typename Method, typename A, typename B, typename C>
- CompletionCallback NewRequiredCallback(Method method, const A& a,
- const B& b, const C& c) {
- CompletionCallback cc = NewCallback(method, a, b, c);
- cc.set_flags(cc.flags() & ~PP_COMPLETIONCALLBACK_FLAG_OPTIONAL);
- return cc;
- }
-
/// NewOptionalCallback() allocates a new, single-use
/// <code>CompletionCallback</code> that might not run if the method
/// taking it can complete synchronously. Thus, if after passing the