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

Side by Side Diff: components/test_runner/test_runner.cc

Issue 1886763002: Fix crash when AppBannerClient is null when resolveBeforeInstallPromptPromise is called. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no-find-copies 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 | third_party/WebKit/LayoutTests/app_banner/testrunner-resolve-crash.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/test_runner/test_runner.h" 5 #include "components/test_runner/test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 request_id, event_platforms, 2951 request_id, event_platforms,
2952 base::Bind(&TestRunner::DispatchBeforeInstallPromptCallback, 2952 base::Bind(&TestRunner::DispatchBeforeInstallPromptCallback,
2953 weak_factory_.GetWeakPtr(), 2953 weak_factory_.GetWeakPtr(),
2954 base::Passed(v8::UniquePersistent<v8::Function>( 2954 base::Passed(v8::UniquePersistent<v8::Function>(
2955 blink::mainThreadIsolate(), callback)))); 2955 blink::mainThreadIsolate(), callback))));
2956 } 2956 }
2957 2957
2958 void TestRunner::ResolveBeforeInstallPromptPromise( 2958 void TestRunner::ResolveBeforeInstallPromptPromise(
2959 int request_id, 2959 int request_id,
2960 const std::string& platform) { 2960 const std::string& platform) {
2961 if (!test_interfaces_->GetAppBannerClient())
2962 return;
2961 test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform); 2963 test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform);
2962 } 2964 }
2963 2965
2964 void TestRunner::RunIdleTasks(v8::Local<v8::Function> callback) { 2966 void TestRunner::RunIdleTasks(v8::Local<v8::Function> callback) {
2965 delegate_->RunIdleTasks( 2967 delegate_->RunIdleTasks(
2966 CreateClosureThatPostsV8Callback(callback)); 2968 CreateClosureThatPostsV8Callback(callback));
2967 } 2969 }
2968 2970
2969 void TestRunner::SetPOSIXLocale(const std::string& locale) { 2971 void TestRunner::SetPOSIXLocale(const std::string& locale) {
2970 delegate_->SetLocale(locale); 2972 delegate_->SetLocale(locale);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3249 } 3251 }
3250 3252
3251 void TestRunner::DidLosePointerLockInternal() { 3253 void TestRunner::DidLosePointerLockInternal() {
3252 bool was_locked = pointer_locked_; 3254 bool was_locked = pointer_locked_;
3253 pointer_locked_ = false; 3255 pointer_locked_ = false;
3254 if (was_locked) 3256 if (was_locked)
3255 web_view_->didLosePointerLock(); 3257 web_view_->didLosePointerLock();
3256 } 3258 }
3257 3259
3258 } // namespace test_runner 3260 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/app_banner/testrunner-resolve-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698