Index: ui/snapshot/screenshot_grabber.cc |
diff --git a/ui/snapshot/screenshot_grabber.cc b/ui/snapshot/screenshot_grabber.cc |
index 02e91df313d20d67b9dc3cad3979f9f20949d7b8..da79cb28737e6278252c412fe1c2707ec235ebc0 100644 |
--- a/ui/snapshot/screenshot_grabber.cc |
+++ b/ui/snapshot/screenshot_grabber.cc |
@@ -43,7 +43,7 @@ using ShowNotificationCallback = |
void SaveScreenshot(scoped_refptr<base::TaskRunner> ui_task_runner, |
const ShowNotificationCallback& callback, |
const base::FilePath& screenshot_path, |
- scoped_refptr<base::RefCountedBytes> png_data, |
+ scoped_refptr<base::RefCountedMemory> png_data, |
ScreenshotGrabberDelegate::FileResult result, |
const base::FilePath& local_path) { |
DCHECK(!base::MessageLoopForUI::IsCurrent()); |
@@ -57,7 +57,7 @@ void SaveScreenshot(scoped_refptr<base::TaskRunner> ui_task_runner, |
// Successfully got a local file to write to, write png data. |
DCHECK_GT(static_cast<int>(png_data->size()), 0); |
if (static_cast<size_t>(base::WriteFile( |
- local_path, reinterpret_cast<char*>(&(png_data->data()[0])), |
+ local_path, reinterpret_cast<const char*>(png_data->front()), |
static_cast<int>(png_data->size()))) != png_data->size()) { |
LOG(ERROR) << "Failed to save to " << local_path.value(); |
screenshot_result = |
@@ -168,7 +168,7 @@ void ScreenshotGrabber::TakeScreenshot(gfx::NativeWindow window, |
cursor_hider_ = ScopedCursorHider::Create(aura_window->GetRootWindow()); |
#endif |
- ui::GrabWindowSnapshotAsync( |
+ ui::GrabWindowSnapshotAsyncPNG( |
window, rect, blocking_task_runner_, |
base::Bind(&ScreenshotGrabber::GrabWindowSnapshotAsyncCallback, |
factory_.GetWeakPtr(), window_identifier, screenshot_path, |
@@ -209,7 +209,7 @@ void ScreenshotGrabber::GrabWindowSnapshotAsyncCallback( |
const std::string& window_identifier, |
base::FilePath screenshot_path, |
bool is_partial, |
- scoped_refptr<base::RefCountedBytes> png_data) { |
+ scoped_refptr<base::RefCountedMemory> png_data) { |
DCHECK(base::MessageLoopForUI::IsCurrent()); |
if (!png_data.get()) { |
if (is_partial) { |