| 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 "content/renderer/browser_plugin/mock_browser_plugin_manager.h" | 5 #include "content/renderer/browser_plugin/mock_browser_plugin_manager.h" |
| 6 | 6 |
| 7 #include "ipc/ipc_message.h" | 7 #include "ipc/ipc_message.h" |
| 8 #include "content/renderer/browser_plugin/mock_browser_plugin.h" | 8 #include "content/renderer/browser_plugin/mock_browser_plugin.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 MockBrowserPluginManager::MockBrowserPluginManager() { | 12 MockBrowserPluginManager::MockBrowserPluginManager( |
| 13 RenderViewImpl* render_view) |
| 14 : BrowserPluginManager(render_view) { |
| 13 } | 15 } |
| 14 | 16 |
| 15 MockBrowserPluginManager::~MockBrowserPluginManager() { | 17 MockBrowserPluginManager::~MockBrowserPluginManager() { |
| 16 } | 18 } |
| 17 | 19 |
| 18 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( | 20 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( |
| 19 RenderViewImpl* render_view, | 21 RenderViewImpl* render_view, |
| 20 WebKit::WebFrame* frame, | 22 WebKit::WebFrame* frame, |
| 21 const WebKit::WebPluginParams& params) { | 23 const WebKit::WebPluginParams& params) { |
| 22 return new MockBrowserPlugin(browser_plugin_counter_++, | 24 return new MockBrowserPlugin(browser_plugin_counter_++, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 reply_deserializer_->SerializeOutputParameters(*msg); | 45 reply_deserializer_->SerializeOutputParameters(*msg); |
| 44 reply_deserializer_.reset(); | 46 reply_deserializer_.reset(); |
| 45 } | 47 } |
| 46 } else { | 48 } else { |
| 47 if (msg->is_sync()) { | 49 if (msg->is_sync()) { |
| 48 // We actually need to handle deleting the reply deserializer for sync | 50 // We actually need to handle deleting the reply deserializer for sync |
| 49 // messages. | 51 // messages. |
| 50 reply_deserializer_.reset( | 52 reply_deserializer_.reset( |
| 51 static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer()); | 53 static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer()); |
| 52 } | 54 } |
| 53 OnControlMessageReceived(*msg); | 55 OnMessageReceived(*msg); |
| 54 } | 56 } |
| 55 delete msg; | 57 delete msg; |
| 56 return true; | 58 return true; |
| 57 } | 59 } |
| 58 | 60 |
| 59 bool MockBrowserPluginManager::OnControlMessageReceived( | 61 bool MockBrowserPluginManager::OnMessageReceived( |
| 60 const IPC::Message& message) { | 62 const IPC::Message& message) { |
| 61 // Save the message in the sink. | 63 // Save the message in the sink. |
| 62 sink_.OnMessageReceived(message); | 64 sink_.OnMessageReceived(message); |
| 63 return false; | 65 return false; |
| 64 } | 66 } |
| 65 | 67 |
| 66 } // namespace content | 68 } // namespace content |
| OLD | NEW |