diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 23:36:15 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 23:36:15 +0000 |
commit | d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7 (patch) | |
tree | b56aac35897a683b276ec3c861f2e9d54a66f940 /content/plugin | |
parent | c9bd2e8e19e8c5891d68e99b4c610c04a62046a0 (diff) | |
download | chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.zip chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.tar.gz chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.tar.bz2 |
Delete the plugin printing code, which wasn't actually called.
Review URL: http://codereview.chromium.org/6874023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r-- | content/plugin/plugin_channel.h | 1 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.cc | 62 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.h | 6 |
3 files changed, 1 insertions, 68 deletions
diff --git a/content/plugin/plugin_channel.h b/content/plugin/plugin_channel.h index f3c50fc..50b2054 100644 --- a/content/plugin/plugin_channel.h +++ b/content/plugin/plugin_channel.h @@ -9,6 +9,7 @@ #include <vector> #include "base/memory/ref_counted.h" #include "base/memory/scoped_handle.h" +#include "base/process.h" #include "build/build_config.h" #include "content/plugin/plugin_channel_base.h" #include "content/plugin/webplugin_delegate_stub.h" diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc index 73a46ad..9555313 100644 --- a/content/plugin/webplugin_delegate_stub.cc +++ b/content/plugin/webplugin_delegate_stub.cc @@ -22,10 +22,6 @@ #include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/glue/webcursor.h" -#if defined(OS_WIN) -#include "printing/metafile_impl.h" -#endif // defined(OS_WIN) - using WebKit::WebBindings; using WebKit::WebCursorInfo; using webkit::npapi::WebPlugin; @@ -104,7 +100,6 @@ bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PluginMsg_HandleInputEvent, OnHandleInputEvent) IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint) IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint) - IPC_MESSAGE_HANDLER(PluginMsg_Print, OnPrint) IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, OnGetPluginScriptableObject) IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) @@ -266,36 +261,6 @@ void WebPluginDelegateStub::OnDidPaint() { webplugin_->DidPaint(); } -void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, - uint32* size) { -#if defined(OS_WIN) - printing::NativeMetafile metafile; - if (!metafile.Init()) { - NOTREACHED(); - return; - } - HDC hdc = metafile.context(); - skia::PlatformDevice::InitializeDC(hdc); - delegate_->Print(hdc); - if (!metafile.FinishDocument()) { - NOTREACHED(); - return; - } - - *size = metafile.GetDataSize(); - DCHECK(*size); - base::SharedMemory shared_buf; - CreateSharedBuffer(*size, &shared_buf, shared_memory); - - // Retrieve a copy of the data. - bool success = metafile.GetData(shared_buf.memory(), *size); - DCHECK(success); -#else - // TODO(port): plugin printing. - NOTIMPLEMENTED(); -#endif -} - void WebPluginDelegateStub::OnUpdateGeometry( const PluginMsg_UpdateGeometry_Param& param) { webplugin_->UpdateGeometry( @@ -398,33 +363,6 @@ void WebPluginDelegateStub::OnInstallMissingPlugin() { delegate_->InstallMissingPlugin(); } -void WebPluginDelegateStub::CreateSharedBuffer( - uint32 size, - base::SharedMemory* shared_buf, - base::SharedMemoryHandle* remote_handle) { - if (!shared_buf->CreateAndMapAnonymous(size)) { - NOTREACHED(); - shared_buf->Close(); - return; - } - -#if defined(OS_WIN) - BOOL result = DuplicateHandle(GetCurrentProcess(), - shared_buf->handle(), - channel_->renderer_handle(), - 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". -#else - // TODO(port): this should use TransportDIB. - NOTIMPLEMENTED(); -#endif -} - void WebPluginDelegateStub::OnHandleURLRequestReply( unsigned long resource_id, const GURL& url, int notify_id) { WebPluginResourceClient* resource_client = diff --git a/content/plugin/webplugin_delegate_stub.h b/content/plugin/webplugin_delegate_stub.h index 48442fa..b602a04 100644 --- a/content/plugin/webplugin_delegate_stub.h +++ b/content/plugin/webplugin_delegate_stub.h @@ -10,7 +10,6 @@ #include <vector> #include "base/memory/ref_counted.h" -#include "base/shared_memory.h" #include "base/task.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" @@ -73,7 +72,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, bool* handled, WebCursor* cursor); void OnPaint(const gfx::Rect& damaged_rect); void OnDidPaint(); - void OnPrint(base::SharedMemoryHandle* shared_memory, uint32* size); void OnUpdateGeometry(const PluginMsg_UpdateGeometry_Param& param); void OnGetPluginScriptableObject(int* route_id); void OnSendJavaScriptStream(const GURL& url, @@ -104,10 +102,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, int notify_id); void OnHTTPRangeRequestReply(unsigned long resource_id, int range_request_id); - void CreateSharedBuffer(uint32 size, - base::SharedMemory* shared_buf, - base::SharedMemoryHandle* remote_handle); - std::string mime_type_; int instance_id_; |