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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1864313002: Fix UaF of BlinkTestRunner caused by incorrect base::Unretained. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shell/renderer/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <clocale> 9 #include <clocale>
10 #include <cmath> 10 #include <cmath>
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 Send(new ShellViewHostMsg_ImageDump( 896 Send(new ShellViewHostMsg_ImageDump(
897 routing_id(), actual_pixel_hash, snapshot)); 897 routing_id(), actual_pixel_hash, snapshot));
898 } 898 }
899 899
900 CaptureDumpComplete(); 900 CaptureDumpComplete();
901 } 901 }
902 902
903 void BlinkTestRunner::CaptureDumpComplete() { 903 void BlinkTestRunner::CaptureDumpComplete() {
904 render_view()->GetWebView()->mainFrame()->stopLoading(); 904 render_view()->GetWebView()->mainFrame()->stopLoading();
905 905
906 base::ThreadTaskRunnerHandle::Get()->PostTask( 906 Send(new ShellViewHostMsg_TestFinished(routing_id()));
Łukasz Anforowicz 2016/04/06 22:45:28 The asynchronous posting came from https://chromiu
907 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send),
908 base::Unretained(this),
909 new ShellViewHostMsg_TestFinished(routing_id())));
910 } 907 }
911 908
912 mojom::LayoutTestBluetoothFakeAdapterSetter& 909 mojom::LayoutTestBluetoothFakeAdapterSetter&
913 BlinkTestRunner::GetBluetoothFakeAdapterSetter() { 910 BlinkTestRunner::GetBluetoothFakeAdapterSetter() {
914 if (!bluetooth_fake_adapter_setter_) { 911 if (!bluetooth_fake_adapter_setter_) {
915 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( 912 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService(
916 mojo::GetProxy(&bluetooth_fake_adapter_setter_)); 913 mojo::GetProxy(&bluetooth_fake_adapter_setter_));
917 } 914 }
918 return *bluetooth_fake_adapter_setter_; 915 return *bluetooth_fake_adapter_setter_;
919 } 916 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 get_bluetooth_events_callbacks_.pop_front(); 979 get_bluetooth_events_callbacks_.pop_front();
983 callback.Run(events); 980 callback.Run(events);
984 } 981 }
985 982
986 void BlinkTestRunner::ReportLeakDetectionResult( 983 void BlinkTestRunner::ReportLeakDetectionResult(
987 const LeakDetectionResult& report) { 984 const LeakDetectionResult& report) {
988 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 985 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
989 } 986 }
990 987
991 } // namespace content 988 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698