forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert 144071 - Add a regenerate button to regenerate the password in…
… Windows. BUG=120480 TEST=Not tested. Review URL: https://chromiumcodereview.appspot.com/10642009 TBR=zysxqn@google.com Review URL: https://chromiumcodereview.appspot.com/10659022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144074 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
jam@chromium.org
committed
Jun 26, 2012
1 parent
4a44f66
commit 6dba1dd
Showing
55 changed files
with
6,986 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
# | ||
# This DEPS file exists so that it can capture the dependenciez of RLZ. This | ||
# allows external projects to check it out and build it independently from all | ||
# of chrome. | ||
|
||
vars = { | ||
"chrev": "@119173" | ||
} | ||
|
||
deps = { | ||
"src/base": | ||
"http://src.chromium.org/svn/trunk/src/base" + Var("chrev"), | ||
|
||
"src/build": | ||
"http://src.chromium.org/svn/trunk/src/build" + Var("chrev"), | ||
|
||
"src/third_party/icu": | ||
"http://src.chromium.org/svn/trunk/deps/third_party/icu42" + Var("chrev"), | ||
|
||
"src/third_party/modp_b64": | ||
"http://src.chromium.org/svn/trunk/src/third_party/modp_b64" + Var("chrev"), | ||
|
||
"src/third_party/nss": | ||
"http://src.chromium.org/svn/trunk/deps/third_party/nss" + Var("chrev"), | ||
|
||
"src/third_party/sqlite": | ||
"http://src.chromium.org/svn/trunk/src/third_party/sqlite" + Var("chrev"), | ||
|
||
"src/third_party/wtl": | ||
"http://src.chromium.org/svn/trunk/src/third_party/wtl" + Var("chrev"), | ||
|
||
"src/third_party/zlib": | ||
"http://src.chromium.org/svn/trunk/src/third_party/zlib" + Var("chrev"), | ||
|
||
"src/testing": | ||
"http://src.chromium.org/svn/trunk/src/testing" + Var("chrev"), | ||
|
||
"src/testing/gmock": | ||
"http://googlemock.googlecode.com/svn/trunk@374", | ||
|
||
"src/testing/gtest": | ||
"http://googletest.googlecode.com/svn/trunk@492", | ||
|
||
"src/tools/gyp": | ||
"http://gyp.googlecode.com/svn/trunk@1233", | ||
|
||
"src/tools/win": | ||
"http://src.chromium.org/svn/trunk/src/tools/win" + Var("chrev"), | ||
|
||
# If using rlz with chrome's networking library, add it and its dependencies | ||
# here. | ||
} | ||
|
||
include_rules = [ | ||
"+build", | ||
"+net", # This is only used when force_rlz_use_chrome_net=1 is passed to gyp. | ||
"+third_party/zlib", | ||
] | ||
|
||
hooks = [ | ||
{ | ||
# A change to a .gyp, .gypi, or to GYP itself should run the generator. | ||
"pattern": ".", | ||
"action": ["python", "src/build/gyp_chromium", "src/rlz/rlz.gyp"], | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set noparent | ||
rogerta@chromium.org | ||
gwilson@chromium.org | ||
thakis@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// Macros specific to the RLZ library. | ||
|
||
#include "rlz/lib/assert.h" | ||
|
||
namespace rlz_lib { | ||
|
||
#ifdef MUTE_EXPECTED_ASSERTS | ||
std::string expected_assertion_; | ||
#endif | ||
|
||
} // namespace rlz_lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// Macros specific to the RLZ library. | ||
|
||
#ifndef RLZ_LIB_ASSERT_H_ | ||
#define RLZ_LIB_ASSERT_H_ | ||
|
||
#include <string> | ||
#include "base/logging.h" | ||
|
||
// An assertion macro. | ||
// Can mute expected assertions in debug mode. | ||
|
||
#ifndef ASSERT_STRING | ||
#ifndef MUTE_EXPECTED_ASSERTS | ||
#define ASSERT_STRING(expr) LOG_IF(FATAL, false) << (expr) | ||
#else | ||
#define ASSERT_STRING(expr) \ | ||
do { \ | ||
std::string expr_string(expr); \ | ||
if (rlz_lib::expected_assertion_ != expr_string) { \ | ||
LOG_IF(FATAL, false) << (expr); \ | ||
} \ | ||
} while (0) | ||
#endif | ||
#endif | ||
|
||
|
||
#ifndef VERIFY | ||
#ifdef _DEBUG | ||
#define VERIFY(expr) LOG_IF(FATAL, !(expr)) << #expr | ||
#else | ||
#define VERIFY(expr) (void)(expr) | ||
#endif | ||
#endif | ||
|
||
namespace rlz_lib { | ||
|
||
#ifdef MUTE_EXPECTED_ASSERTS | ||
extern std::string expected_assertion_; | ||
#endif | ||
|
||
inline void SetExpectedAssertion(const char* s) { | ||
#ifdef MUTE_EXPECTED_ASSERTS | ||
expected_assertion_ = s; | ||
#endif | ||
} | ||
|
||
} // rlz_lib | ||
|
||
#endif // RLZ_LIB_ASSERT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// A wrapper around ZLib's CRC function. | ||
|
||
#ifndef RLZ_LIB_CRC32_H_ | ||
#define RLZ_LIB_CRC32_H_ | ||
|
||
namespace rlz_lib { | ||
|
||
int Crc32(const unsigned char* buf, int length); | ||
bool Crc32(const char* text, int* crc); | ||
|
||
} // namespace rlz_lib | ||
|
||
#endif // RLZ_LIB_CRC32_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// A test for ZLib's checksum function. | ||
|
||
#include "rlz/lib/crc32.h" | ||
|
||
#include "base/logging.h" | ||
#include "testing/gmock/include/gmock/gmock.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
TEST(Crc32Unittest, ByteTest) { | ||
struct { | ||
const char* data; | ||
int len; | ||
// Externally calculated at http://crc32-checksum.waraxe.us/ | ||
int crc; | ||
} kData[] = { | ||
{"Hello" , 5, 0xF7D18982}, | ||
{"Google" , 6, 0x62B0F067}, | ||
{"" , 0, 0x0}, | ||
{"One more string.", 16, 0x0CA14970}, | ||
{NULL , 0, 0x0}, | ||
}; | ||
|
||
for (int i = 0; kData[i].data; i++) | ||
EXPECT_EQ(kData[i].crc, | ||
rlz_lib::Crc32(reinterpret_cast<const unsigned char*>(kData[i].data), | ||
kData[i].len)); | ||
} | ||
|
||
TEST(Crc32Unittest, CharTest) { | ||
struct { | ||
const char* data; | ||
// Externally calculated at http://crc32-checksum.waraxe.us/ | ||
int crc; | ||
} kData[] = { | ||
{"Hello" , 0xF7D18982}, | ||
{"Google" , 0x62B0F067}, | ||
{"" , 0x0}, | ||
{"One more string.", 0x0CA14970}, | ||
{"Google\r\n" , 0x83A3E860}, | ||
{NULL , 0x0}, | ||
}; | ||
|
||
int crc; | ||
for (int i = 0; kData[i].data; i++) { | ||
EXPECT_TRUE(rlz_lib::Crc32(kData[i].data, &crc)); | ||
EXPECT_EQ(kData[i].crc, crc); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// A wrapper around ZLib's CRC functions to put them in the rlz_lib namespace | ||
// and use our types. | ||
|
||
#include "rlz/lib/assert.h" | ||
#include "rlz/lib/crc32.h" | ||
#include "rlz/lib/string_utils.h" | ||
#include "third_party/zlib/zlib.h" | ||
|
||
namespace rlz_lib { | ||
|
||
int Crc32(const unsigned char* buf, int length) { | ||
return crc32(0L, buf, length); | ||
} | ||
|
||
bool Crc32(const char* text, int* crc) { | ||
if (!crc) { | ||
ASSERT_STRING("Crc32: crc is NULL."); | ||
return false; | ||
} | ||
|
||
*crc = 0; | ||
for (int i = 0; text[i]; i++) { | ||
if (!IsAscii(text[i])) | ||
return false; | ||
|
||
*crc = crc32(*crc, reinterpret_cast<const unsigned char*>(text + i), 1); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
} // namespace rlz_lib |
Oops, something went wrong.