Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ipc/ipc_channel_proxy.h" | 11 #include "ipc/ipc_channel_proxy.h" |
| 12 #include "ipc/ipc_logging.h" | 12 #include "ipc/ipc_logging.h" |
| 13 #include "ipc/ipc_message_utils.h" | 13 #include "ipc/ipc_message_utils.h" |
| 14 | 14 |
| 15 namespace IPC { | 15 namespace IPC { |
| 16 | 16 |
| 17 // This helper ensures the message is deleted if the task is deleted without | 17 // This helper ensures the message is deleted if the task is deleted without |
| 18 // having been run. | 18 // having been run. |
| 19 class SendCallbackHelper | 19 class SendCallbackHelper |
|
jam
2012/04/13 18:16:41
oh, looks like we don't even need this class anymo
| |
| 20 : public base::RefCountedThreadSafe<SendCallbackHelper> { | 20 : public base::RefCountedThreadSafe<SendCallbackHelper> { |
| 21 public: | 21 public: |
| 22 SendCallbackHelper(ChannelProxy::Context* context, Message* message) | 22 SendCallbackHelper(ChannelProxy::Context* context, Message* message) |
| 23 : context_(context), | 23 : context_(context), |
| 24 message_(message) { | 24 message_(message) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void Send() { | 27 void Send() { |
| 28 context_->OnSendMessage(message_.release()); | 28 context_->OnSendMessage(message_.release()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 friend class base::RefCountedThreadSafe<SendCallbackHelper>; | |
| 33 ~SendCallbackHelper() {} | |
| 34 | |
| 32 scoped_refptr<ChannelProxy::Context> context_; | 35 scoped_refptr<ChannelProxy::Context> context_; |
| 33 scoped_ptr<Message> message_; | 36 scoped_ptr<Message> message_; |
| 34 | 37 |
| 35 DISALLOW_COPY_AND_ASSIGN(SendCallbackHelper); | 38 DISALLOW_COPY_AND_ASSIGN(SendCallbackHelper); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 //------------------------------------------------------------------------------ | 41 //------------------------------------------------------------------------------ |
| 39 | 42 |
| 40 ChannelProxy::MessageFilter::MessageFilter() {} | 43 ChannelProxy::MessageFilter::MessageFilter() {} |
| 41 | 44 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 Channel* channel = context_.get()->channel_.get(); | 411 Channel* channel = context_.get()->channel_.get(); |
| 409 // Channel must have been created first. | 412 // Channel must have been created first. |
| 410 DCHECK(channel) << context_.get()->channel_id_; | 413 DCHECK(channel) << context_.get()->channel_id_; |
| 411 return channel->GetClientEuid(client_euid); | 414 return channel->GetClientEuid(client_euid); |
| 412 } | 415 } |
| 413 #endif | 416 #endif |
| 414 | 417 |
| 415 //----------------------------------------------------------------------------- | 418 //----------------------------------------------------------------------------- |
| 416 | 419 |
| 417 } // namespace IPC | 420 } // namespace IPC |
| OLD | NEW |