diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-10 01:01:10 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-10 01:01:10 +0000 |
commit | 232aabfca535b962d41aae13f08104292b40cbaa (patch) | |
tree | 5b0bb37f4262fc797b9b71c3011e4d5142c6ba1a /ppapi/examples | |
parent | 5d50b28df12016b7582497cd7282454622b52782 (diff) | |
download | chromium_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/examples')
-rw-r--r-- | ppapi/examples/audio_input/audio_input.cc | 4 | ||||
-rw-r--r-- | ppapi/examples/flash_topmost/flash_topmost.cc | 4 | ||||
-rw-r--r-- | ppapi/examples/gamepad/gamepad.cc | 2 | ||||
-rw-r--r-- | ppapi/examples/mouse_lock/mouse_lock.cc | 13 | ||||
-rw-r--r-- | ppapi/examples/url_loader/streaming.cc | 4 |
5 files changed, 12 insertions, 15 deletions
diff --git a/ppapi/examples/audio_input/audio_input.cc b/ppapi/examples/audio_input/audio_input.cc index 44fd337..7aff669 100644 --- a/ppapi/examples/audio_input/audio_input.cc +++ b/ppapi/examples/audio_input/audio_input.cc @@ -130,7 +130,7 @@ class MyInstance : public pp::Instance { PP_DCHECK(timer_interval_ > 0); pp::Module::Get()->core()->CallOnMainThread( timer_interval_, - callback_factory_.NewRequiredCallback(&MyInstance::OnTimer), + callback_factory_.NewCallback(&MyInstance::OnTimer), 0); } @@ -161,7 +161,7 @@ class MyInstance : public pp::Instance { device_context_.ReplaceContents(&image); waiting_for_flush_completion_ = true; device_context_.Flush( - callback_factory_.NewRequiredCallback(&MyInstance::DidFlush)); + callback_factory_.NewCallback(&MyInstance::DidFlush)); } } diff --git a/ppapi/examples/flash_topmost/flash_topmost.cc b/ppapi/examples/flash_topmost/flash_topmost.cc index fe17092..dcdcd23 100644 --- a/ppapi/examples/flash_topmost/flash_topmost.cc +++ b/ppapi/examples/flash_topmost/flash_topmost.cc @@ -45,7 +45,7 @@ class MyInstance : public pp::Instance { void ScheduleNextTimer() { pp::Module::Get()->core()->CallOnMainThread( kTimerInterval, - callback_factory_.NewRequiredCallback(&MyInstance::OnTimer), + callback_factory_.NewCallback(&MyInstance::OnTimer), 0); } @@ -76,7 +76,7 @@ class MyInstance : public pp::Instance { device_context_.ReplaceContents(&image); waiting_for_flush_completion_ = true; device_context_.Flush( - callback_factory_.NewRequiredCallback(&MyInstance::DidFlush)); + callback_factory_.NewCallback(&MyInstance::DidFlush)); } } diff --git a/ppapi/examples/gamepad/gamepad.cc b/ppapi/examples/gamepad/gamepad.cc index eb2c8fc..96a127c 100644 --- a/ppapi/examples/gamepad/gamepad.cc +++ b/ppapi/examples/gamepad/gamepad.cc @@ -78,7 +78,7 @@ class MyInstance : public pp::Instance { if (!image.is_null()) { device_context_.ReplaceContents(&image); device_context_.Flush( - callback_factory_.NewRequiredCallback(&MyInstance::OnFlush)); + callback_factory_.NewCallback(&MyInstance::OnFlush)); } else { printf("NullImage\n"); } diff --git a/ppapi/examples/mouse_lock/mouse_lock.cc b/ppapi/examples/mouse_lock/mouse_lock.cc index f6bfbb6..7eec828 100644 --- a/ppapi/examples/mouse_lock/mouse_lock.cc +++ b/ppapi/examples/mouse_lock/mouse_lock.cc @@ -51,8 +51,7 @@ class MyInstance : public pp::Instance, public pp::MouseLock { pp::MouseInputEvent mouse_event(event); if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT && !mouse_locked_) { - LockMouse( - callback_factory_.NewRequiredCallback(&MyInstance::DidLockMouse)); + LockMouse(callback_factory_.NewCallback(&MyInstance::DidLockMouse)); } return true; } @@ -69,12 +68,10 @@ class MyInstance : public pp::Instance, public pp::MouseLock { pp::KeyboardInputEvent key_event(event); // Lock the mouse when the Enter key is pressed. if (key_event.GetKeyCode() == 13) { - if (mouse_locked_) { + if (mouse_locked_) UnlockMouse(); - } else { - LockMouse(callback_factory_.NewRequiredCallback( - &MyInstance::DidLockMouse)); - } + else + LockMouse(callback_factory_.NewCallback(&MyInstance::DidLockMouse)); return true; } return false; @@ -135,7 +132,7 @@ class MyInstance : public pp::Instance, public pp::MouseLock { device_context_.ReplaceContents(&image); waiting_for_flush_completion_ = true; device_context_.Flush( - callback_factory_.NewRequiredCallback(&MyInstance::DidFlush)); + callback_factory_.NewCallback(&MyInstance::DidFlush)); } } diff --git a/ppapi/examples/url_loader/streaming.cc b/ppapi/examples/url_loader/streaming.cc index b7186ae..80ee4f0 100644 --- a/ppapi/examples/url_loader/streaming.cc +++ b/ppapi/examples/url_loader/streaming.cc @@ -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. @@ -82,7 +82,7 @@ void MyInstance::StartRequest(const std::string& url) { loader_ = pp::URLLoader(this); loader_.Open(request, - factory_.NewRequiredCallback(&MyInstance::OnOpenComplete)); + factory_.NewCallback(&MyInstance::OnOpenComplete)); } void MyInstance::OnOpenComplete(int32_t result) { |