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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2034663003: Remove use of deprecated MessageLoop methods in content. (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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/android/build_info.h" 11 #include "base/android/build_info.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/callback_helpers.h" 13 #include "base/callback_helpers.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/location.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
18 #include "base/message_loop/message_loop.h"
19 #include "base/metrics/histogram.h" 19 #include "base/metrics/histogram.h"
20 #include "base/single_thread_task_runner.h"
20 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
21 #include "base/sys_info.h" 22 #include "base/sys_info.h"
23 #include "base/threading/thread_task_runner_handle.h"
22 #include "base/threading/worker_pool.h" 24 #include "base/threading/worker_pool.h"
23 #include "cc/layers/layer.h" 25 #include "cc/layers/layer.h"
24 #include "cc/layers/surface_layer.h" 26 #include "cc/layers/surface_layer.h"
25 #include "cc/output/compositor_frame.h" 27 #include "cc/output/compositor_frame.h"
26 #include "cc/output/compositor_frame_ack.h" 28 #include "cc/output/compositor_frame_ack.h"
27 #include "cc/output/copy_output_request.h" 29 #include "cc/output/copy_output_request.h"
28 #include "cc/output/copy_output_result.h" 30 #include "cc/output/copy_output_result.h"
29 #include "cc/output/latency_info_swap_promise.h" 31 #include "cc/output/latency_info_swap_promise.h"
30 #include "cc/resources/single_release_callback.h" 32 #include "cc/resources/single_release_callback.h"
31 #include "cc/surfaces/surface.h" 33 #include "cc/surfaces/surface.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 .c_str()); 200 .c_str());
199 provider_->SetLostContextCallback( 201 provider_->SetLostContextCallback(
200 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); 202 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this)));
201 gl_helper_.reset(new display_compositor::GLHelper( 203 gl_helper_.reset(new display_compositor::GLHelper(
202 provider_->ContextGL(), provider_->ContextSupport())); 204 provider_->ContextGL(), provider_->ContextSupport()));
203 } 205 }
204 206
205 void GLHelperHolder::OnContextLost() { 207 void GLHelperHolder::OnContextLost() {
206 // Need to post a task because the command buffer client cannot be deleted 208 // Need to post a task because the command buffer client cannot be deleted
207 // from within this callback. 209 // from within this callback.
208 base::MessageLoop::current()->PostTask( 210 base::ThreadTaskRunnerHandle::Get()->PostTask(
209 FROM_HERE, base::Bind(&RenderWidgetHostViewAndroid::OnContextLost)); 211 FROM_HERE, base::Bind(&RenderWidgetHostViewAndroid::OnContextLost));
210 } 212 }
211 213
212 // This can only be used for readback postprocessing. It may return null if the 214 // This can only be used for readback postprocessing. It may return null if the
213 // channel was lost and not reestablished yet. 215 // channel was lost and not reestablished yet.
214 display_compositor::GLHelper* GetPostReadbackGLHelper() { 216 display_compositor::GLHelper* GetPostReadbackGLHelper() {
215 static GLHelperHolder* g_readback_helper_holder = nullptr; 217 static GLHelperHolder* g_readback_helper_holder = nullptr;
216 218
217 if (g_readback_helper_holder && g_readback_helper_holder->IsLost()) { 219 if (g_readback_helper_holder && g_readback_helper_holder->IsLost()) {
218 delete g_readback_helper_holder; 220 delete g_readback_helper_holder;
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 case ui::MotionEvent::ACTION_UP: 2037 case ui::MotionEvent::ACTION_UP:
2036 case ui::MotionEvent::ACTION_POINTER_UP: 2038 case ui::MotionEvent::ACTION_POINTER_UP:
2037 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 2039 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
2038 delta.InMicroseconds(), 1, 1000000, 50); 2040 delta.InMicroseconds(), 1, 1000000, 50);
2039 default: 2041 default:
2040 return; 2042 return;
2041 } 2043 }
2042 } 2044 }
2043 2045
2044 } // namespace content 2046 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698