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

Side by Side Diff: content/shell/renderer/test_runner/TestRunner.cpp

Issue 171423004: Fix uninit read in TestRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /* 5 /*
6 * Copyright (C) 2010 Google Inc. All rights reserved. 6 * Copyright (C) 2010 Google Inc. All rights reserved.
7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) 7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
8 * Copyright (C) 2012 Apple Inc. All Rights Reserved. 8 * Copyright (C) 2012 Apple Inc. All Rights Reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool ()) 1325 if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool ())
1326 return; 1326 return;
1327 WebView::injectStyleSheet( 1327 WebView::injectStyleSheet(
1328 cppVariantToWebString(arguments[0]), WebVector<WebString>(), 1328 cppVariantToWebString(arguments[0]), WebVector<WebString>(),
1329 arguments[1].toBoolean() ? WebView::InjectStyleInAllFrames : WebView::In jectStyleInTopFrameOnly); 1329 arguments[1].toBoolean() ? WebView::InjectStyleInAllFrames : WebView::In jectStyleInTopFrameOnly);
1330 } 1330 }
1331 1331
1332 void TestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) 1332 void TestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result)
1333 { 1333 {
1334 result->setNull(); 1334 result->setNull();
1335 if (arguments.size() != 1) 1335 if (arguments.size() != 1 || !arguments[0].isObject())
1336 return; 1336 return;
1337 1337
1338 WebElement element; 1338 WebElement element;
1339 if (!WebBindings::getElement(arguments[0].value.objectValue, &element)) 1339 if (!WebBindings::getElement(arguments[0].value.objectValue, &element))
1340 return; 1340 return;
1341 1341
1342 WebInputElement* input = toWebInputElement(&element); 1342 WebInputElement* input = toWebInputElement(&element);
1343 if (!input) 1343 if (!input)
1344 return; 1344 return;
1345 1345
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1380
1381 WebFrame* frame = m_webView->mainFrame(); 1381 WebFrame* frame = m_webView->mainFrame();
1382 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0); 1382 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0);
1383 frame->stopFinding(false); 1383 frame->stopFinding(false);
1384 result->set(findResult); 1384 result->set(findResult);
1385 } 1385 }
1386 1386
1387 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult) 1387 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult)
1388 { 1388 {
1389 result->setNull(); 1389 result->setNull();
1390 if (arguments.size() != 2) 1390 if (arguments.size() != 2 || !arguments[0].isObject() || !arguments[0].isStr ing())
1391 return; 1391 return;
1392 1392
1393 WebElement element; 1393 WebElement element;
1394 if (!WebBindings::getElement(arguments[0].value.objectValue, &element)) 1394 if (!WebBindings::getElement(arguments[0].value.objectValue, &element))
1395 return; 1395 return;
1396 1396
1397 WebInputElement* input = toWebInputElement(&element); 1397 WebInputElement* input = toWebInputElement(&element);
1398 if (!input) 1398 if (!input)
1399 return; 1399 return;
1400 1400
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 result->setNull(); 2116 result->setNull();
2117 } 2117 }
2118 2118
2119 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) 2119 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result)
2120 { 2120 {
2121 m_pointerLockPlannedResult = PointerLockWillFailSync; 2121 m_pointerLockPlannedResult = PointerLockWillFailSync;
2122 result->setNull(); 2122 result->setNull();
2123 } 2123 }
2124 2124
2125 } 2125 }
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