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 "content/renderer/browser_plugin/mock_browser_plugin.h" | 5 #include "content/renderer/browser_plugin/mock_browser_plugin.h" |
| 6 #include "content/renderer/render_process_impl.h" | |
| 6 | 7 |
| 7 namespace content { | 8 namespace content { |
| 8 | 9 |
| 9 MockBrowserPlugin::MockBrowserPlugin( | 10 MockBrowserPlugin::MockBrowserPlugin( |
| 10 int id, | 11 int id, |
| 11 RenderViewImpl* render_view, | 12 RenderViewImpl* render_view, |
| 12 WebKit::WebFrame* frame, | 13 WebKit::WebFrame* frame, |
| 13 const WebKit::WebPluginParams& params) | 14 const WebKit::WebPluginParams& params) |
| 14 : BrowserPlugin(id, render_view, frame, params) { | 15 : BrowserPlugin(id, render_view, frame, params), |
| 16 transport_dib_next_sequence_number_(0) { | |
| 15 } | 17 } |
| 16 | 18 |
| 17 MockBrowserPlugin::~MockBrowserPlugin() {} | 19 MockBrowserPlugin::~MockBrowserPlugin() {} |
| 18 | 20 |
| 21 TransportDIB* MockBrowserPlugin::CreateTransportDIB(const size_t size) { | |
| 22 return TransportDIB::Create(size, transport_dib_next_sequence_number_++); | |
| 23 } | |
| 24 | |
| 25 void MockBrowserPlugin::FreeDamageBuffer() { | |
| 26 if (damage_buffer_) { | |
|
Fady Samuel
2012/09/28 23:46:48
Please replace this guard with a DCHECK
lazyboy
2012/09/29 00:50:06
Done.
| |
| 27 RenderProcess::current()->FreeTransportDIB(damage_buffer_); | |
| 28 damage_buffer_ = NULL; | |
| 29 } | |
| 30 } | |
| 31 | |
| 19 } // namespace content | 32 } // namespace content |
| OLD | NEW |