Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Side by Side Diff: ui/snapshot/screenshot_grabber.cc

Issue 2054573002: Remove MessageLoop::current()->task_runner() in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/snapshot/screenshot_grabber.h" 5 #include "ui/snapshot/screenshot_grabber.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <climits> 9 #include <climits>
10 #include <string> 10 #include <string>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/location.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/single_thread_task_runner.h"
17 #include "base/task_runner.h" 19 #include "base/task_runner.h"
18 #include "base/threading/sequenced_worker_pool.h" 20 #include "base/threading/sequenced_worker_pool.h"
21 #include "base/threading/thread_task_runner_handle.h"
19 #include "base/time/time.h" 22 #include "base/time/time.h"
20 #include "ui/gfx/image/image.h" 23 #include "ui/gfx/image/image.h"
21 #include "ui/snapshot/snapshot.h" 24 #include "ui/snapshot/snapshot.h"
22 25
23 #if defined(USE_AURA) 26 #if defined(USE_AURA)
24 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
25 #endif 28 #endif
26 29
27 namespace ui { 30 namespace ui {
28 31
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ScreenshotGrabberObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED, 188 ScreenshotGrabberObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED,
186 screenshot_path); 189 screenshot_path);
187 } 190 }
188 return; 191 return;
189 } 192 }
190 193
191 ShowNotificationCallback notification_callback(base::Bind( 194 ShowNotificationCallback notification_callback(base::Bind(
192 &ScreenshotGrabber::NotifyScreenshotCompleted, factory_.GetWeakPtr())); 195 &ScreenshotGrabber::NotifyScreenshotCompleted, factory_.GetWeakPtr()));
193 client_->PrepareFileAndRunOnBlockingPool( 196 client_->PrepareFileAndRunOnBlockingPool(
194 screenshot_path, blocking_task_runner_, 197 screenshot_path, blocking_task_runner_,
195 base::Bind(&SaveScreenshot, base::MessageLoop::current()->task_runner(), 198 base::Bind(&SaveScreenshot, base::ThreadTaskRunnerHandle::Get(),
196 notification_callback, screenshot_path, png_data)); 199 notification_callback, screenshot_path, png_data));
197 } 200 }
198 201
199 } // namespace ui 202 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/test/windowed_nsnotification_observer.mm ('k') | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698