Skip to content

Commit

Permalink
Spell length correctly
Browse files Browse the repository at this point in the history
$ git grep -l lenght | xargs sed -i 's$lenght$length$g'
$ git grep -l Lenght | xargs sed -i 's$Lenght$Length$g'
$ git grep -l LENGHT | xargs sed -i 's$LENGHT$LENGTH$g'

TBR=jam@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.win:win10_chromium_x64_rel_ng
Change-Id: Ifb5f726445554d530f5e3c8c06e302e7b849ea1f
Bug: 
Reviewed-on: https://chromium-review.googlesource.com/692579
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514583}
  • Loading branch information
tanderson-google authored and Commit Bot committed Nov 7, 2017
1 parent 14b4134 commit 1c00250
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion chrome/browser/browser_keyevents_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const char kSetTextBoxValueJS[] =
const char kStartTestJS[] =
"window.domAutomationController.send(startTest(%d));";

// Maximum lenght of the result array in KeyEventTestData structure.
// Maximum length of the result array in KeyEventTestData structure.
const size_t kMaxResultLength = 10;

// A structure holding test data of a keyboard event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ bool IsPersistentNotification(
// These numbers have been obtained through experimentation on various
// Mac OS platforms.

constexpr size_t kMaxDomainLenghtAlert = 19;
constexpr size_t kMaxDomainLenghtBanner = 28;
constexpr size_t kMaxDomainLengthAlert = 19;
constexpr size_t kMaxDomainLengthBanner = 28;

size_t max_characters = IsPersistentNotification(notification)
? kMaxDomainLenghtAlert
: kMaxDomainLenghtBanner;
? kMaxDomainLengthAlert
: kMaxDomainLengthBanner;

base::string16 origin = url_formatter::FormatOriginForSecurityDisplay(
url::Origin::Create(notification.origin_url()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function abortWriteFile(volumeId, entry, path, callback) {
});
}

// Truncates file entry/path to lenght |lenght|.
// Truncates file entry/path to length |length|.
function truncateFile(volumeId, entry, path, length, expectSuccess, callback) {
var message = 'Truncating file: \'' + path + '\' to length ' + length + '.';
getFile(volumeId, entry, path, false, true, function(entry) {
Expand Down
2 changes: 1 addition & 1 deletion components/omnibox/browser/autocomplete_i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Any time this is used the result will be incorrect in some cases that
// certain users will be able to discern. Ideally, this class would be deleted
// and we would do full Unicode case-sensitivity mappings using
// base::i18n::ToLower. However, ToLower can change the lenghts of strings,
// base::i18n::ToLower. However, ToLower can change the lengths of strings,
// making computations of offsets or prefix lengths difficult. Getting all
// edge cases correct will require careful implementation and testing. In the
// mean time, we use this simpler approach.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LoopbackServerEntity;
namespace {

static const int kCurrentLoopbackServerProtoVersion = 1;
static const int kKeystoreKeyLenght = 16;
static const int kKeystoreKeyLength = 16;

// Properties of the bookmark bar permanent folders.
static const char kBookmarkBarFolderServerTag[] = "bookmark_bar";
Expand Down Expand Up @@ -154,7 +154,7 @@ void LoopbackServer::Init() {

std::string LoopbackServer::GenerateNewKeystoreKey() const {
// TODO(pastarmovj): Check if true random bytes is ok or alpha-nums is needed?
return base::RandBytesAsString(kKeystoreKeyLenght);
return base::RandBytesAsString(kKeystoreKeyLength);
}

bool LoopbackServer::CreatePermanentBookmarkFolder(
Expand Down
2 changes: 1 addition & 1 deletion ios/chrome/common/string_util_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

EXPECT_NSEQ(SubstringOfWidth(@"asdf", attributes, 100, NO), @"asdf");

// construct some string of known lenghts
// construct some string of known lengths
NSString* leading = @"some text";
NSString* trailing = @"some other text";
NSString* mid = @"some text for the method to do some actual work";
Expand Down
2 changes: 1 addition & 1 deletion net/disk_cache/blockfile/disk_format_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct SparseHeader {
uint32_t magic; // Structure identifier (equal to kIndexMagic).
int32_t parent_key_len; // Key length for the parent entry.
int32_t last_block; // Index of the last written block.
int32_t last_block_len; // Lenght of the last written block.
int32_t last_block_len; // Length of the last written block.
int32_t dummy[10];
};

Expand Down
2 changes: 1 addition & 1 deletion net/proxy/proxy_bypass_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class NET_EXPORT ProxyBypassRules {
// Examples:
// "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
//
// (4) IP_LITERAL "/" PREFIX_LENGHT_IN_BITS
// (4) IP_LITERAL "/" PREFIX_LENGTH_IN_BITS
//
// Match any URL that is to an IP literal that falls between the
// given range. IP range is specified using CIDR notation.
Expand Down
4 changes: 2 additions & 2 deletions sandbox/win/src/filesystem_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NTSTATUS NtCreateFileInTarget(HANDLE* target_file_handle,
ULONG create_disposition,
ULONG create_options,
PVOID ea_buffer,
ULONG ea_lenght,
ULONG ea_length,
HANDLE target_process) {
NtCreateFileFunction NtCreateFile = nullptr;
ResolveNTFunctionPtr("NtCreateFile", &NtCreateFile);
Expand All @@ -39,7 +39,7 @@ NTSTATUS NtCreateFileInTarget(HANDLE* target_file_handle,
NTSTATUS status =
NtCreateFile(&local_handle, desired_access, obj_attributes,
io_status_block, nullptr, file_attributes, share_access,
create_disposition, create_options, ea_buffer, ea_lenght);
create_disposition, create_options, ea_buffer, ea_length);
if (!NT_SUCCESS(status)) {
return status;
}
Expand Down
14 changes: 7 additions & 7 deletions sandbox/win/src/policy_engine_opcodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ EvalResult OpcodeEval<OP_NUMBER_AND_MATCH>(PolicyOpcode* opcode,
// Opcode OpWStringMatch:
// Requires a wchar_t* in selected_param.
// Argument 0 is the byte displacement of the stored string.
// Argument 1 is the lenght in chars of the stored string.
// Argument 1 is the length in chars of the stored string.
// Argument 2 is the offset to apply on the input string. It has special values.
// as noted in the header file.
// Argument 3 is the string matching options.
Expand All @@ -232,7 +232,7 @@ PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16_t selected_param,
if ('\0' == match_str[0])
return nullptr;

int lenght = lstrlenW(match_str);
int length = lstrlenW(match_str);

PolicyOpcode* opcode = MakeBase(OP_WSTRING_MATCH, options, selected_param);
if (!opcode)
Expand All @@ -241,7 +241,7 @@ PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16_t selected_param,
if (0 == delta_str)
return nullptr;
opcode->SetArgument(0, delta_str);
opcode->SetArgument(1, lenght);
opcode->SetArgument(1, length);
opcode->SetArgument(2, start_position);
opcode->SetArgument(3, match_opts);
return opcode;
Expand Down Expand Up @@ -291,8 +291,8 @@ EvalResult OpcodeEval<OP_WSTRING_MATCH>(PolicyOpcode* opcode,
if (start_position >= 0) {
if (kSeekToEnd == start_position) {
start_position = source_len - match_len;
} else if (match_opts & EXACT_LENGHT) {
// A sub-case of case 3 is when the EXACT_LENGHT flag is on
} else if (match_opts & EXACT_LENGTH) {
// A sub-case of case 3 is when the EXACT_LENGTH flag is on
// the match needs to be not just substring but full match.
if ((match_len + start_position) != source_len) {
return EVAL_FALSE;
Expand Down Expand Up @@ -365,8 +365,8 @@ PolicyOpcode* OpcodeFactory::MakeBase(OpcodeID opcode_id,

ptrdiff_t OpcodeFactory::AllocRelative(void* start,
const wchar_t* str,
size_t lenght) {
size_t bytes = lenght * sizeof(wchar_t);
size_t length) {
size_t bytes = length * sizeof(wchar_t);
if (memory_size() < bytes)
return 0;
memory_bottom_ -= bytes;
Expand Down
4 changes: 2 additions & 2 deletions sandbox/win/src/policy_engine_opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class PolicyOpcode {
enum StringMatchOptions {
CASE_SENSITIVE = 0, // Pay or Not attention to the case as defined by
CASE_INSENSITIVE = 1, // RtlCompareUnicodeString windows API.
EXACT_LENGHT = 2 // Don't do substring match. Do full string match.
EXACT_LENGTH = 2 // Don't do substring match. Do full string match.
};

// Opcodes that do string comparisons take a parameter that is the starting
Expand Down Expand Up @@ -362,7 +362,7 @@ class OpcodeFactory {

// Allocates (and copies) a string (of size length) inside the buffer and
// returns the displacement with respect to start.
ptrdiff_t AllocRelative(void* start, const wchar_t* str, size_t lenght);
ptrdiff_t AllocRelative(void* start, const wchar_t* str, size_t length);

// Points to the lowest currently available address of the memory
// used to make the opcodes. This pointer increments as opcodes are made.
Expand Down
2 changes: 1 addition & 1 deletion sandbox/win/src/policy_low_level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ bool PolicyRule::GenStringOpcode(RuleType rule_type,
*skip_count = 0;
} else {
if (last_call) {
match_opts = static_cast<StringMatchOptions>(EXACT_LENGHT | match_opts);
match_opts = static_cast<StringMatchOptions>(EXACT_LENGTH | match_opts);
}
op = opcode_factory_->MakeOpWStringMatch(parameter, fragment->c_str(), 0,
match_opts, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function loadComplete() {
The maxLength attribute is the maximum number of text characters for text
fields, when type has the value of Text or Password.
Retrieve the maxLenght attribute of the 1st INPUT element and examine
Retrieve the maxLength attribute of the 1st INPUT element and examine
its value.
* @author NIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function loadComplete() {
The maxLength attribute is the maximum number of text characters for text
fields, when type has the value of Text or Password.
Retrieve the maxLenght attribute of the 1st INPUT element and examine
Retrieve the maxLength attribute of the 1st INPUT element and examine
its value.
* @author NIST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>CSS3 Grid Layout: Flexible Lenght</title>
<title>CSS3 Grid Layout: Flexible Length</title>
<link rel="author" title="swain" href="mailto:swainet@126.com"/>
<link rel="reviewer" title="Dayang Shen" href="mailto:shendayang@baidu.com"/> <!-- 2013-09-22 -->
<link rel="help" href="http://www.w3.org/TR/css-grid-1/#fr-unit"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FAIL ImageData(buffer, w), the buffer size must be a multiple of 4 assert_throws
new ImageData(new Uint8ClampedArray(3), 1);
}" threw object "IndexSizeError: Failed to construct 'ImageData': The input data length is not a multiple of 4." that is not a DOMException InvalidStateError: property "code" is equal to 1, expected 11
PASS ImageData(buffer, w), buffer size must be a multiple of the image width
PASS ImageData(buffer, w, h), buffer.lenght == 4 * w * h must be true
PASS ImageData(buffer, w, h), buffer.length == 4 * w * h must be true
FAIL ImageData(buffer, w, opt h), Uint8ClampedArray argument type check assert_throws: function "function () {
new ImageData(new Int8Array(1), 1);
}" threw object "IndexSizeError: Failed to construct 'ImageData': The source width is zero or not a number." ("IndexSizeError") expected object "TypeError" ("TypeError")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
assert_throws("IndexSizeError", function() {
new ImageData(new Uint8ClampedArray(16), 4, 3);
});
}, "ImageData(buffer, w, h), buffer.lenght == 4 * w * h must be true");
}, "ImageData(buffer, w, h), buffer.length == 4 * w * h must be true");

test(function() {
assert_throws(new TypeError(), function() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1c00250

Please sign in to comment.