| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <atlbase.h> | 10 #include <atlbase.h> |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 bool WebPluginDelegateProxy::CreateBitmap( | 426 bool WebPluginDelegateProxy::CreateBitmap( |
| 427 scoped_ptr<base::SharedMemory>* memory, | 427 scoped_ptr<base::SharedMemory>* memory, |
| 428 scoped_ptr<skia::PlatformCanvas>* canvas) { | 428 scoped_ptr<skia::PlatformCanvas>* canvas) { |
| 429 #if defined(OS_WIN) | 429 #if defined(OS_WIN) |
| 430 size_t size = GetPaintBufSize(plugin_rect_); | 430 size_t size = GetPaintBufSize(plugin_rect_); |
| 431 scoped_ptr<base::SharedMemory> new_shared_memory(new base::SharedMemory()); | 431 scoped_ptr<base::SharedMemory> new_shared_memory(new base::SharedMemory()); |
| 432 if (!new_shared_memory->Create(L"", false, true, size)) | 432 if (!new_shared_memory->Create(L"", false, true, size)) |
| 433 return false; | 433 return false; |
| 434 | 434 |
| 435 scoped_ptr<skia::PlatformCanvasWin> new_canvas(new skia::PlatformCanvasWin); | 435 scoped_ptr<skia::PlatformCanvas> new_canvas(new skia::PlatformCanvas); |
| 436 if (!new_canvas->initialize(plugin_rect_.width(), plugin_rect_.height(), | 436 if (!new_canvas->initialize(plugin_rect_.width(), plugin_rect_.height(), |
| 437 true, new_shared_memory->handle())) { | 437 true, new_shared_memory->handle())) { |
| 438 return false; | 438 return false; |
| 439 } | 439 } |
| 440 | 440 |
| 441 memory->swap(new_shared_memory); | 441 memory->swap(new_shared_memory); |
| 442 canvas->swap(new_canvas); | 442 canvas->swap(new_canvas); |
| 443 return true; | 443 return true; |
| 444 #else | 444 #else |
| 445 // TODO(port): use TransportDIB properly. | 445 // TODO(port): use TransportDIB properly. |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 plugin_->CancelDocumentLoad(); | 909 plugin_->CancelDocumentLoad(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 912 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 913 const std::string& url, const std::string& range_info, | 913 const std::string& url, const std::string& range_info, |
| 914 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 914 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
| 915 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 915 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 916 existing_stream, notify_needed, | 916 existing_stream, notify_needed, |
| 917 notify_data); | 917 notify_data); |
| 918 } | 918 } |
| OLD | NEW |