summaryrefslogtreecommitdiffstats
path: root/chrome/nacl/nacl_ipc_adapter.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 00:34:37 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 00:34:37 +0000
commitc239336e9507a35a758fe58f54e7b3efcf02d48c (patch)
tree51da45b8e712fd44d076be40c5f457c59fe4b3c0 /chrome/nacl/nacl_ipc_adapter.cc
parenta9d22bfa79c527163815d848b8baef6de152c1df (diff)
downloadchromium_src-c239336e9507a35a758fe58f54e7b3efcf02d48c.zip
chromium_src-c239336e9507a35a758fe58f54e7b3efcf02d48c.tar.gz
chromium_src-c239336e9507a35a758fe58f54e7b3efcf02d48c.tar.bz2
RefCounted types should not have public destructors, chrome/nacl edition
Additionally, convert a scoped_ptr<> to a scoped_refptr<> BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10069051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl/nacl_ipc_adapter.cc')
-rw-r--r--chrome/nacl/nacl_ipc_adapter.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/nacl/nacl_ipc_adapter.cc b/chrome/nacl/nacl_ipc_adapter.cc
index 8f13c57..cf5ae2f 100644
--- a/chrome/nacl/nacl_ipc_adapter.cc
+++ b/chrome/nacl/nacl_ipc_adapter.cc
@@ -57,6 +57,9 @@ class NaClIPCAdapter::RewrittenMessage
int Read(char* dest_buffer, int dest_buffer_size);
private:
+ friend class base::RefCounted<RewrittenMessage>;
+ ~RewrittenMessage() {}
+
scoped_array<char> data_;
int data_len_;
@@ -126,9 +129,6 @@ NaClIPCAdapter::NaClIPCAdapter(scoped_ptr<IPC::Channel> channel,
io_thread_data_.channel_ = channel.Pass();
}
-NaClIPCAdapter::~NaClIPCAdapter() {
-}
-
// Note that this message is controlled by the untrusted code. So we should be
// skeptical of anything it contains and quick to give up if anything is fishy.
int NaClIPCAdapter::Send(const char* input_data, size_t input_data_len) {
@@ -255,6 +255,9 @@ void NaClIPCAdapter::OnChannelError() {
CloseChannel();
}
+NaClIPCAdapter::~NaClIPCAdapter() {
+}
+
int NaClIPCAdapter::LockedReceive(char* output_buffer, int output_buffer_size) {
lock_.AssertAcquired();
@@ -316,14 +319,6 @@ bool NaClIPCAdapter::SendCompleteMessage(const char* buffer,
return true;
}
-void NaClIPCAdapter::CloseChannelOnIOThread() {
- io_thread_data_.channel_->Close();
-}
-
-void NaClIPCAdapter::SendMessageOnIOThread(scoped_ptr<IPC::Message> message) {
- io_thread_data_.channel_->Send(message.release());
-}
-
void NaClIPCAdapter::ClearToBeSent() {
lock_.AssertAcquired();
@@ -331,3 +326,11 @@ void NaClIPCAdapter::ClearToBeSent() {
std::string empty;
locked_data_.to_be_sent_.swap(empty);
}
+
+void NaClIPCAdapter::CloseChannelOnIOThread() {
+ io_thread_data_.channel_->Close();
+}
+
+void NaClIPCAdapter::SendMessageOnIOThread(scoped_ptr<IPC::Message> message) {
+ io_thread_data_.channel_->Send(message.release());
+}