summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 18:43:55 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 18:43:55 +0000
commit83039bbf2f2ec0e918f7000b5212d104f60f2bb7 (patch)
treeb22dbd0051b57a437a588772a874271f0d02ffdb /webkit
parente7456a206fe5b50aeb322ebabd6c26adc869a5fd (diff)
downloadchromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.zip
chromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.tar.gz
chromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.tar.bz2
Migrate net/socket/socket.h, net/socket/stream_socket.h to base::Bind().
This changes Socket::Read(), Socket::Write, and StreamSocket::Connect() to use CompletionCallback and fixes all users. BUG=none TEST=existing. Review URL: http://codereview.chromium.org/8824006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/ppb_transport_impl.cc15
-rw-r--r--webkit/plugins/ppapi/ppb_transport_impl.h3
2 files changed, 7 insertions, 11 deletions
diff --git a/webkit/plugins/ppapi/ppb_transport_impl.cc b/webkit/plugins/ppapi/ppb_transport_impl.cc
index 44593d4..da656c8 100644
--- a/webkit/plugins/ppapi/ppb_transport_impl.cc
+++ b/webkit/plugins/ppapi/ppb_transport_impl.cc
@@ -68,11 +68,7 @@ WebKit::WebFrame* GetFrameForResource(const ::ppapi::Resource* resource) {
PPB_Transport_Impl::PPB_Transport_Impl(PP_Instance instance)
: Resource(instance),
started_(false),
- writable_(false),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- channel_write_callback_(this, &PPB_Transport_Impl::OnWritten)),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- channel_read_callback_(this, &PPB_Transport_Impl::OnRead)) {
+ writable_(false) {
}
PPB_Transport_Impl::~PPB_Transport_Impl() {
@@ -323,7 +319,9 @@ int32_t PPB_Transport_Impl::Recv(void* data, uint32_t len,
scoped_refptr<net::IOBuffer> buffer =
new net::WrappedIOBuffer(static_cast<const char*>(data));
- int result = MapNetError(channel->Read(buffer, len, &channel_read_callback_));
+ int result = MapNetError(
+ channel->Read(buffer, len, base::Bind(&PPB_Transport_Impl::OnRead,
+ base::Unretained(this))));
if (result == PP_OK_COMPLETIONPENDING) {
recv_callback_ = new TrackedCompletionCallback(
plugin_module->GetCallbackTracker(), pp_resource(), callback);
@@ -352,8 +350,9 @@ int32_t PPB_Transport_Impl::Send(const void* data, uint32_t len,
scoped_refptr<net::IOBuffer> buffer =
new net::WrappedIOBuffer(static_cast<const char*>(data));
- int result = MapNetError(channel->Write(buffer, len,
- &channel_write_callback_));
+ int result = MapNetError(
+ channel->Write(buffer, len, base::Bind(&PPB_Transport_Impl::OnWritten,
+ base::Unretained(this))));
if (result == PP_OK_COMPLETIONPENDING) {
send_callback_ = new TrackedCompletionCallback(
plugin_module->GetCallbackTracker(), pp_resource(), callback);
diff --git a/webkit/plugins/ppapi/ppb_transport_impl.h b/webkit/plugins/ppapi/ppb_transport_impl.h
index f768ad9..1e5ecfa 100644
--- a/webkit/plugins/ppapi/ppb_transport_impl.h
+++ b/webkit/plugins/ppapi/ppb_transport_impl.h
@@ -73,9 +73,6 @@ class PPB_Transport_Impl : public ::ppapi::Resource,
scoped_refptr<TrackedCompletionCallback> recv_callback_;
scoped_refptr<TrackedCompletionCallback> send_callback_;
- net::OldCompletionCallbackImpl<PPB_Transport_Impl> channel_write_callback_;
- net::OldCompletionCallbackImpl<PPB_Transport_Impl> channel_read_callback_;
-
DISALLOW_COPY_AND_ASSIGN(PPB_Transport_Impl);
};