Skip to content

Commit

Permalink
NO CODE CHANGE (except one global std::wstring changed to const wchar…
Browse files Browse the repository at this point in the history
…_t* const per style compliance).

Preliminary work to enforce new PRESUBMIT.py rules:
- <=80 cols
- no trailing whitespaces
- svn:eol-style=LF

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
maruel@chromium.org committed Mar 3, 2009
1 parent 7d926f9 commit 52a261f
Show file tree
Hide file tree
Showing 77 changed files with 363 additions and 369 deletions.
2 changes: 1 addition & 1 deletion base/at_exit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace base {
// AtExitManager object on the stack:
// int main(...) {
// base::AtExitManager exit_manager;
//
//
// }
// When the exit_manager object goes out of scope, all the registered
// callbacks and singleton destructors will be called.
Expand Down
4 changes: 2 additions & 2 deletions base/at_exit_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TEST(AtExitTest, Basic) {
base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);
base::AtExitManager::RegisterCallback(&IncrementTestCounter2, NULL);
base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);

EXPECT_EQ(0, g_test_counter_1);
EXPECT_EQ(0, g_test_counter_2);
base::AtExitManager::ProcessCallbacksNow();
Expand All @@ -67,7 +67,7 @@ TEST(AtExitTest, LIFOOrder) {
base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);
base::AtExitManager::RegisterCallback(&ExpectCounter1IsZero, NULL);
base::AtExitManager::RegisterCallback(&IncrementTestCounter2, NULL);

EXPECT_EQ(0, g_test_counter_1);
EXPECT_EQ(0, g_test_counter_2);
base::AtExitManager::ProcessCallbacksNow();
Expand Down
2 changes: 1 addition & 1 deletion base/atomicops_internals_x86_gcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void AtomicOps_Internalx86CPUFeaturesInit() {

// Opteron Rev E has a bug in which on very rare occasions a locked
// instruction doesn't act as a read-acquire barrier if followed by a
// non-locked read-modify-write instruction. Rev F has this bug in
// non-locked read-modify-write instruction. Rev F has this bug in
// pre-release versions, but not in versions released to customers,
// so we test only for Rev E, which is family 15, model 32..63 inclusive.
if (strcmp(vendor, "AuthenticAMD") == 0 && // AMD
Expand Down
4 changes: 2 additions & 2 deletions base/base_paths_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef BASE_BASE_PATHS_MAC_H_
#define BASE_BASE_PATHS_MAC_H_

// This file declares Mac-specific path keys for the base module.
// These can be used with the PathService to access various special
// This file declares Mac-specific path keys for the base module.
// These can be used with the PathService to access various special
// directories and files.

namespace base {
Expand Down
4 changes: 2 additions & 2 deletions base/base_paths_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef BASE_BASE_PATHS_WIN_H__
#define BASE_BASE_PATHS_WIN_H__

// This file declares windows-specific path keys for the base module.
// These can be used with the PathService to access various special
// This file declares windows-specific path keys for the base module.
// These can be used with the PathService to access various special
// directories and files.

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion base/clipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Clipboard {
// CBF_BOOKMARK html char array
// url char array
// CBF_LINK html char array
// url char array
// url char array
// CBF_FILES files char array representing multiple files.
// Filenames are separated by null characters and
// the final filename is double null terminated.
Expand Down
2 changes: 1 addition & 1 deletion base/clipboard_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#if defined(OS_WIN)
class ClipboardTest : public PlatformTest {
protected:
protected:
virtual void SetUp() {
message_loop_.reset(new MessageLoopForUI());
}
Expand Down
7 changes: 5 additions & 2 deletions base/clipboard_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ bool ClipboardUtil::GetUrl(IDataObject* data_object,
PathIsUNCA(data.get()))) {
char file_url[INTERNET_MAX_URL_LENGTH];
DWORD file_url_len = sizeof(file_url) / sizeof(file_url[0]);
if (SUCCEEDED(::UrlCreateFromPathA(data.get(), file_url, &file_url_len, 0))) {
if (SUCCEEDED(::UrlCreateFromPathA(data.get(),
file_url,
&file_url_len,
0))) {
*url = UTF8ToWide(file_url);
title->assign(*url);
success = true;
Expand Down Expand Up @@ -396,7 +399,7 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object,
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Helper method for converting from text/html to MS CF_HTML.
Expand Down
3 changes: 2 additions & 1 deletion base/clipboard_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ void Clipboard::WriteBitmapFromSharedMemory(const char* bitmap_data,
BITMAPINFO bm_info = {0};
bm_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bm_info.bmiHeader.biWidth = size->width();
bm_info.bmiHeader.biHeight = -size->height(); // Sets the vertical orientation
// Sets the vertical orientation.
bm_info.bmiHeader.biHeight = -size->height();
bm_info.bmiHeader.biPlanes = 1;
bm_info.bmiHeader.biBitCount = 32;
bm_info.bmiHeader.biCompression = BI_RGB;
Expand Down
2 changes: 1 addition & 1 deletion base/cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void CPU::Initialize() {
// __cpuid with an InfoType argument of 0 returns the number of
// valid Ids in CPUInfo[0] and the CPU identification string in
// the other three array elements. The CPU identification string is
// not in linear order. The code below arranges the information
// not in linear order. The code below arranges the information
// in a human readable form.
//
// More info can be found here:
Expand Down
2 changes: 1 addition & 1 deletion base/file_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ std::wstring FilePath::ToWStringHack() const {
FilePath FilePath::StripTrailingSeparators() const {
FilePath new_path(path_);
new_path.StripTrailingSeparatorsInternal();

return new_path;
}

Expand Down
2 changes: 1 addition & 1 deletion base/file_version_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class FileVersionInfo {
VS_FIXEDFILEINFO* fixed_file_info_;
#elif defined(OS_MACOSX)
explicit FileVersionInfo(NSBundle *bundle);

NSBundle *bundle_;
#elif defined(OS_LINUX)
FileVersionInfo();
Expand Down
4 changes: 3 additions & 1 deletion base/gfx/jpeg_codec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ namespace {
const static int initial_output_buffer_size = 8192;

struct JpegEncoderState {
JpegEncoderState(std::vector<unsigned char>* o) : out(o), image_buffer_used(0) {
JpegEncoderState(std::vector<unsigned char>* o)
: out(o),
image_buffer_used(0) {
}

// Output buffer, of which 'image_buffer_used' bytes are actually used (this
Expand Down
17 changes: 9 additions & 8 deletions base/gfx/native_theme.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ HRESULT NativeTheme::PaintButton(HDC hdc,
if (handle && get_theme_content_rect_) {
get_theme_content_rect_(handle, hdc, part_id, state_id, rect, rect);
} else {
InflateRect(rect, -GetSystemMetrics(SM_CXEDGE),
InflateRect(rect, -GetSystemMetrics(SM_CXEDGE),
-GetSystemMetrics(SM_CYEDGE));
}
DrawFocusRect(hdc, rect);
Expand Down Expand Up @@ -193,13 +193,14 @@ HRESULT NativeTheme::PaintScrollbarArrow(HDC hdc,
return S_OK;
}

HRESULT NativeTheme::PaintScrollbarTrack(HDC hdc,
int part_id,
int state_id,
int classic_state,
RECT* target_rect,
RECT* align_rect,
skia::PlatformCanvasWin* canvas) const {
HRESULT NativeTheme::PaintScrollbarTrack(
HDC hdc,
int part_id,
int state_id,
int classic_state,
RECT* target_rect,
RECT* align_rect,
skia::PlatformCanvasWin* canvas) const {
HANDLE handle = GetThemeHandle(SCROLLBAR);
if (handle && draw_theme_)
return draw_theme_(handle, hdc, part_id, state_id, target_rect, NULL);
Expand Down
12 changes: 8 additions & 4 deletions base/gfx/png_codec_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ TEST(PNGCodec, StripAddAlpha) {

// Encode RGBA data as RGB.
std::vector<unsigned char> encoded;
EXPECT_TRUE(PNGEncoder::Encode(&original_rgba[0], PNGEncoder::FORMAT_RGBA, w, h,
w * 4, true, &encoded));
EXPECT_TRUE(PNGEncoder::Encode(&original_rgba[0],
PNGEncoder::FORMAT_RGBA,
w, h,
w * 4, true, &encoded));

// Decode the RGB to RGBA.
std::vector<unsigned char> decoded;
Expand All @@ -182,8 +184,10 @@ TEST(PNGCodec, StripAddAlpha) {
ASSERT_TRUE(original_rgba == decoded);

// Encode RGBA to RGBA.
EXPECT_TRUE(PNGEncoder::Encode(&original_rgba[0], PNGEncoder::FORMAT_RGBA, w, h,
w * 4, false, &encoded));
EXPECT_TRUE(PNGEncoder::Encode(&original_rgba[0],
PNGEncoder::FORMAT_RGBA,
w, h,
w * 4, false, &encoded));

// Decode the RGBA to RGB.
EXPECT_TRUE(PNGDecoder::Decode(&encoded[0], encoded.size(),
Expand Down
5 changes: 4 additions & 1 deletion base/gfx/png_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ bool PNGDecoder::Decode(const unsigned char* input, size_t input_size,

png_set_progressive_read_fn(png_ptr, &state, &DecodeInfoCallback,
&DecodeRowCallback, &DecodeEndCallback);
png_process_data(png_ptr, info_ptr, const_cast<unsigned char*>(input), input_size);
png_process_data(png_ptr,
info_ptr,
const_cast<unsigned char*>(input),
input_size);

if (!state.done) {
// Fed it all the data but the library didn't think we got all the data, so
Expand Down
3 changes: 2 additions & 1 deletion base/gfx/png_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ bool PNGEncoder::Encode(const unsigned char* input, ColorFormat format,
if (!converter) {
// No conversion needed, give the data directly to libpng.
for (int y = 0; y < h; y ++)
png_write_row(png_ptr, const_cast<unsigned char*>(&input[y * row_byte_width]));
png_write_row(png_ptr,
const_cast<unsigned char*>(&input[y * row_byte_width]));
} else {
// Needs conversion using a separate buffer.
unsigned char* row = new unsigned char[w * output_color_components];
Expand Down
2 changes: 1 addition & 1 deletion base/hash_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Deal with the differences between Microsoft and GNU implemenations
// of hash_map. Allows all platforms to use |base::hash_map| and
// |base::hash_set|.
// eg:
// eg:
// base::hash_map<int> my_map;
// base::hash_set<int> my_set;
//
Expand Down
12 changes: 6 additions & 6 deletions base/icu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
#include "unicode/putil.h"
#include "unicode/udata.h"

#define ICU_UTIL_DATA_FILE 0
#define ICU_UTIL_DATA_SHARED 1
#define ICU_UTIL_DATA_STATIC 2
#define ICU_UTIL_DATA_FILE 0
#define ICU_UTIL_DATA_SHARED 1
#define ICU_UTIL_DATA_STATIC 2

#ifndef ICU_UTIL_DATA_IMPL

#if defined(OS_WIN)
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_SHARED
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_SHARED
#elif defined(OS_MACOSX)
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_STATIC
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_STATIC
#elif defined(OS_LINUX)
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_FILE
#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_FILE
#endif

#endif // ICU_UTIL_DATA_IMPL
Expand Down
10 changes: 5 additions & 5 deletions base/idle_timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ bool OSIdleTimeSource(int32 *milliseconds_interval_since_last_event) {
return false;
}
int32 last_input_time = lastInputInfo.dwTime;
// Note: On Windows GetLastInputInfo returns a 32bit value which rolls over

// Note: On Windows GetLastInputInfo returns a 32bit value which rolls over
// ~49days.
int32 current_time = GetTickCount();
int32 delta = current_time - last_input_time;
// delta will go negative if we've been idle for 2GB of ticks.
if (delta < 0)
delta = -delta;
delta = -delta;
*milliseconds_interval_since_last_event = delta;
return true;
}
#elif defined(OS_MACOSX)
bool OSIdleTimeSource(int32 *milliseconds_interval_since_last_event) {
*milliseconds_interval_since_last_event =
*milliseconds_interval_since_last_event =
CGEventSourceSecondsSinceLastEventType(
kCGEventSourceStateCombinedSessionState,
kCGEventSourceStateCombinedSessionState,
kCGAnyInputEventType) * 1000.0;
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions base/idletimer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static Time mock_timer_started;

bool MockIdleTimeSource(int32 *milliseconds_interval_since_last_event) {
TimeDelta delta = Time::Now() - mock_timer_started;
*milliseconds_interval_since_last_event =
*milliseconds_interval_since_last_event =
static_cast<int32>(delta.InMilliseconds());
return true;
}
Expand Down Expand Up @@ -112,7 +112,7 @@ TEST_F(IdleTimerTest, NoRepeatFlipIdleOnce) {
base::OneShotTimer<TestFinishedTask> t1;
t1.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
&TestFinishedTask::Run);

base::OneShotTimer<ResetIdleTask> t2;
t2.Start(TimeDelta::FromMilliseconds(4 * kSafeTestIntervalMs), &reset_task,
&ResetIdleTask::Run);
Expand All @@ -138,7 +138,7 @@ TEST_F(IdleTimerTest, NoRepeatNotIdle) {
base::OneShotTimer<TestFinishedTask> t;
t.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
&TestFinishedTask::Run);

base::RepeatingTimer<ResetIdleTask> reset_timer;
reset_timer.Start(TimeDelta::FromMilliseconds(50), &reset_task,
&ResetIdleTask::Run);
Expand Down Expand Up @@ -194,7 +194,7 @@ TEST_F(IdleTimerTest, RepeatIdleReset) {
base::OneShotTimer<TestFinishedTask> t1;
t1.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
&TestFinishedTask::Run);

base::OneShotTimer<ResetIdleTask> t2;
t2.Start(TimeDelta::FromMilliseconds(5 * kSafeTestIntervalMs), &reset_task,
&ResetIdleTask::Run);
Expand Down Expand Up @@ -224,7 +224,7 @@ TEST_F(IdleTimerTest, RepeatNotIdle) {
base::OneShotTimer<TestFinishedTask> t;
t.Start(TimeDelta::FromMilliseconds(8 * kSafeTestIntervalMs), &finish_task,
&TestFinishedTask::Run);

base::RepeatingTimer<ResetIdleTask> reset_timer;
reset_timer.Start(TimeDelta::FromMilliseconds(50), &reset_task,
&ResetIdleTask::Run);
Expand Down
2 changes: 1 addition & 1 deletion base/lazy_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// static LazyInstance<MyClass> my_instance(base::LINKER_INITIALIZED);
// void SomeMethod() {
// my_instance.Get().SomeMethod(); // MyClass::SomeMethod()
//
//
// MyClass* ptr = my_instance.Pointer();
// ptr->DoDoDo(); // MyClass::DoDoDo
// }
Expand Down
2 changes: 1 addition & 1 deletion base/lazy_instance_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ TEST(LazyInstanceTest, Basic) {
lazy_logger.Pointer();
EXPECT_EQ(3, constructed_seq_.GetNext());
EXPECT_EQ(2, destructed_seq_.GetNext());
}
}
EXPECT_EQ(4, constructed_seq_.GetNext());
EXPECT_EQ(4, destructed_seq_.GetNext());
}
Expand Down
Loading

0 comments on commit 52a261f

Please sign in to comment.