| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/plugin_data_remover.h" | 5 #include "chrome/browser/plugin_data_remover.h" |
| 6 | 6 |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/plugin_service.h" | 9 #include "chrome/browser/plugin_service.h" |
| 10 #include "chrome/common/plugin_messages.h" | 10 #include "chrome/common/plugin_messages.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 bool PluginDataRemover::OffTheRecord() { | 55 bool PluginDataRemover::OffTheRecord() { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void PluginDataRemover::SetPluginInfo(const WebPluginInfo& info) { | 59 void PluginDataRemover::SetPluginInfo(const WebPluginInfo& info) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 void PluginDataRemover::OnChannelOpened(const IPC::ChannelHandle& handle) { | 62 void PluginDataRemover::OnChannelOpened(const IPC::ChannelHandle& handle) { |
| 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 64 DCHECK(!channel_); | 64 DCHECK(!channel_); |
| 65 #if defined(OS_POSIX) | 65 channel_ = new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this); |
| 66 // If we received a ChannelHandle, register it now. | |
| 67 if (handle.socket.fd >= 0) | |
| 68 IPC::AddChannelSocket(handle.name, handle.socket.fd); | |
| 69 #endif | |
| 70 channel_ = new IPC::Channel(handle.name, IPC::Channel::MODE_CLIENT, this); | |
| 71 if (!channel_->Connect()) { | 66 if (!channel_->Connect()) { |
| 72 NOTREACHED() << "Couldn't connect to plugin"; | 67 NOTREACHED() << "Couldn't connect to plugin"; |
| 73 SignalDone(); | 68 SignalDone(); |
| 74 return; | 69 return; |
| 75 } | 70 } |
| 76 | 71 |
| 77 if (!channel_->Send( | 72 if (!channel_->Send( |
| 78 new PluginMsg_ClearSiteData(0, std::string(), begin_time_))) { | 73 new PluginMsg_ClearSiteData(0, std::string(), begin_time_))) { |
| 79 NOTREACHED() << "Couldn't send ClearSiteData message"; | 74 NOTREACHED() << "Couldn't send ClearSiteData message"; |
| 80 SignalDone(); | 75 SignalDone(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 109 SignalDone(); | 104 SignalDone(); |
| 110 } | 105 } |
| 111 | 106 |
| 112 void PluginDataRemover::SignalDone() { | 107 void PluginDataRemover::SignalDone() { |
| 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 114 if (!done_task_.get()) | 109 if (!done_task_.get()) |
| 115 return; | 110 return; |
| 116 message_loop_->PostTask(FROM_HERE, done_task_.release()); | 111 message_loop_->PostTask(FROM_HERE, done_task_.release()); |
| 117 message_loop_ = NULL; | 112 message_loop_ = NULL; |
| 118 } | 113 } |
| OLD | NEW |