summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 03:25:15 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 03:25:15 +0000
commit176aa48371da91eb98d675d87b4e70c7b26d696f (patch)
tree4c972de6ecd5a54650ab1dc7d421187f5d25834f /chrome/plugin
parent9a3f0ac2899139ace97e399015259d028b4d5704 (diff)
downloadchromium_src-176aa48371da91eb98d675d87b4e70c7b26d696f.zip
chromium_src-176aa48371da91eb98d675d87b4e70c7b26d696f.tar.gz
chromium_src-176aa48371da91eb98d675d87b4e70c7b26d696f.tar.bz2
Add Terminate() to the Process object, have RenderProcessHost use this to avoid some more Windows specific code.
Move Process and SharedMemory into the base namespace (most changes). Review URL: http://codereview.chromium.org/10895 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc11
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h8
-rw-r--r--chrome/plugin/webplugin_proxy.cc12
-rw-r--r--chrome/plugin/webplugin_proxy.h10
4 files changed, 21 insertions, 20 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 158dc45..91df155 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -226,7 +226,7 @@ void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) {
size_t size = emf.GetDataSize();
DCHECK(size);
params->size = size;
- SharedMemory shared_buf;
+ base::SharedMemory shared_buf;
CreateSharedBuffer(size, &shared_buf, &params->shared_memory);
// Retrieve a copy of the data.
@@ -239,8 +239,8 @@ void WebPluginDelegateStub::OnUpdateGeometry(
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
webplugin_->UpdateGeometry(
window_rect, clip_rect, cutout_rects, visible, windowless_buffer,
background_buffer);
@@ -301,8 +301,8 @@ void WebPluginDelegateStub::OnInstallMissingPlugin() {
void WebPluginDelegateStub::CreateSharedBuffer(
size_t size,
- SharedMemory* shared_buf,
- SharedMemoryHandle* remote_handle) {
+ base::SharedMemory* shared_buf,
+ base::SharedMemoryHandle* remote_handle) {
if (!shared_buf->Create(std::wstring(), false, false, size)) {
NOTREACHED();
return;
@@ -319,6 +319,7 @@ void WebPluginDelegateStub::CreateSharedBuffer(
remote_handle, 0, FALSE,
DUPLICATE_SAME_ACCESS);
DCHECK_NE(result, 0);
+
// If the calling function's shared_buf is on the stack, its destructor will
// close the shared memory buffer handle. This is fine since we already
// duplicated the handle to the renderer process so it will stay "alive".
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index d8fed1f..8b49991 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -67,8 +67,8 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
void OnGetPluginScriptableObject(int* route_id, void** npobject_ptr);
void OnSendJavaScriptStream(const std::string& url,
const std::wstring& result,
@@ -90,8 +90,8 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
HANDLE notify_data);
void CreateSharedBuffer(size_t size,
- SharedMemory* shared_buf,
- SharedMemoryHandle* remote_handle);
+ base::SharedMemory* shared_buf,
+ base::SharedMemoryHandle* remote_handle);
int instance_id_;
std::string mime_type_;
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 56beb25c..2cbb3ee 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -279,9 +279,9 @@ void WebPluginProxy::UpdateGeometry(
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
- gfx::Rect old = delegate_->rect();
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
+ gfx::Rect old = delegate_->rect();
bool moved = delegate_->rect().x() != window_rect.x() ||
delegate_->rect().y() != window_rect.y();
delegate_->UpdateGeometry(window_rect, clip_rect, cutout_rects, visible);
@@ -295,8 +295,8 @@ void WebPluginProxy::UpdateGeometry(
}
void WebPluginProxy::SetWindowlessBuffer(
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
// Convert the shared memory handle to a handle that works in our process,
// and then use that to create an HDC.
ConvertBuffer(windowless_buffer,
@@ -312,7 +312,7 @@ void WebPluginProxy::SetWindowlessBuffer(
UpdateTransform();
}
-void WebPluginProxy::ConvertBuffer(const SharedMemoryHandle& buffer,
+void WebPluginProxy::ConvertBuffer(const base::SharedMemoryHandle& buffer,
ScopedHandle* shared_section,
ScopedBitmap* bitmap,
ScopedHDC* hdc) {
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 5374d1c..e6a231d 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -83,8 +83,8 @@ class WebPluginProxy : public WebPlugin {
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
void CancelDocumentLoad();
@@ -98,12 +98,12 @@ class WebPluginProxy : public WebPlugin {
bool Send(IPC::Message* msg);
// Updates the shared memory section where windowless plugins paint.
- void SetWindowlessBuffer(const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ void SetWindowlessBuffer(const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
// Converts a shared memory section handle from the renderer process into a
// bitmap and hdc that are mapped to this process.
- void ConvertBuffer(const SharedMemoryHandle& buffer,
+ void ConvertBuffer(const base::SharedMemoryHandle& buffer,
ScopedHandle* shared_section,
ScopedBitmap* bitmap,
ScopedHDC* hdc);