chromium/src/base.git
3 hours agoMake sure that the UI window created by base::MessagePumpForUI is destoyed on the... master
alexeypa@chromium.org [Thu, 20 Jun 2013 02:38:11 +0000 (02:38 +0000)]
Make sure that the UI window created by base::MessagePumpForUI is destoyed on the same thread (Windows).

Currently the window created base::MessagePumpForUI can be destroyed on a wrong thread. base::MessagePumpForUI is a ref-counted class so it can (and does) outlive the owning base::MessageLoop. As the result DestroyWindow() can be called on a wrong thread. This makes TSAN unhappy and it reports races deep unside user32.dll.

Changes in this CL:
- The message pump is now notified when the owning message loop is being destroyed. The notification is used to free all resources that hve to be released on the base::MessageLoop's thread.
- MessagePumpForUI::ScheduleWork() synchronizes access to the message-only window handle to avoid posting messages to the window during or after its destruction.

BUG=241939

Review URL: https://chromiumcodereview.appspot.com/15709015

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207278 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

26 hours agoRemove "using" from nullable string now that all users are updated.
avi@chromium.org [Wed, 19 Jun 2013 03:54:10 +0000 (03:54 +0000)]
Remove "using" from nullable string now that all users are updated.

BUG=247723
TEST=compile works
TBR=brettw@chromium.org

Review URL: https://chromiumcodereview.appspot.com/17385006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207165 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

31 hours agoMove Firefox importer's INI parser to c/browser/common.
tommycli@chromium.org [Tue, 18 Jun 2013 23:31:12 +0000 (23:31 +0000)]
Move Firefox importer's INI parser to c/browser/common.

Media Galleries API Picasa Import will require reading some INI files. Rather than re-invent the wheel and duplicate code, we are moving the INI parser used by Firefox import into chrome/browser/common.

BUG=151701

Review URL: https://chromiumcodereview.appspot.com/16982004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207111 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

34 hours agoMove message_pump to base/message_loop.
brettw@chromium.org [Tue, 18 Jun 2013 20:27:52 +0000 (20:27 +0000)]
Move message_pump to base/message_loop.

This also fixes some namespace usage inside the message pump files and updates all users of these files to use the new location.

Reland of 206507.
Original review https://codereview.chromium.org/17078005/
TBR=sky

Review URL: https://codereview.chromium.org/16897006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207075 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

35 hours agoMove CreateFIFO() and RedirectStream() from testing/android/ to base/android/.
scherkus@chromium.org [Tue, 18 Jun 2013 19:34:34 +0000 (19:34 +0000)]
Move CreateFIFO() and RedirectStream() from testing/android/ to base/android/.

They will be used by content_shell to create the necessary fifos when running layout tests.

BUG=232044
TBR=darin,yfriedman

Review URL: https://chromiumcodereview.appspot.com/16599008

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207060 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

36 hours agocc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes.
danakj@chromium.org [Tue, 18 Jun 2013 17:39:51 +0000 (17:39 +0000)]
cc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes.

This changes from using cc::Thread to base::SingleThreadTaskRunner in
FrameRateController, DelayBasedTimeSource, and ResourceUpdateController.
Then all unit tests for these classes are switched from using
cc::FakeThread to base::TestSimpleTaskRunner.

This is a step toward deleting cc::Thread and moving to using
MessageLoopProxy directly in cc.

R=piman
BUG=251134

Review URL: https://chromiumcodereview.appspot.com/17362002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@207027 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

41 hours agoMemoryPressureListener: fixes ref-counting.
bulach@chromium.org [Tue, 18 Jun 2013 13:31:56 +0000 (13:31 +0000)]
MemoryPressureListener: fixes ref-counting.

Following crrev.com/205796, the internal observer list is
ref-counted, the lazy instance must keep a ref to it.

BUG=246125

Review URL: https://chromiumcodereview.appspot.com/17242002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206968 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

46 hours agoReplace base::NullableString16(bool) usage with default constructor.
darin@chromium.org [Tue, 18 Jun 2013 08:30:42 +0000 (08:30 +0000)]
Replace base::NullableString16(bool) usage with default constructor.

Review URL: https://chromiumcodereview.appspot.com/17327004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206922 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

46 hours agoDo not show sync promo when RestoreOnStartupURLs policy is set
bartfab@chromium.org [Tue, 18 Jun 2013 08:19:18 +0000 (08:19 +0000)]
Do not show sync promo when RestoreOnStartupURLs policy is set

When first_run_tabs are set through master_preferences, the sync promo
should be shown if not explicitly suppressed. When RestoreOnStartupURLs
is set through policy, the sync promo should never be shown. This is
long-standing behavior, as evidenced here:

http://crbug.com/125467#c26

That behavior recently regressed with the sync promo appearing even if
RestoreOnStartupURLs are set. The regression happened here:

https://chromiumcodereview.appspot.com/12638005

This CL fixes the regression by ensuring that when RestoreOnStartup=4 and
RestoreOnStartupURLs are set, the sync promo is not shown. The CL also
adds browser tests to protect against similar regressions in the future.

BUG=244849
TEST=Manual and new browser_tests

Review URL: https://chromiumcodereview.appspot.com/16141008

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206915 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

47 hours agoMake ifdef condition consistent in platform_thread_linux.cc.
mazda@chromium.org [Tue, 18 Jun 2013 06:48:23 +0000 (06:48 +0000)]
Make ifdef condition consistent in platform_thread_linux.cc.

BUG=170549

Review URL: https://chromiumcodereview.appspot.com/16703022

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206908 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days agoFix wrong header guards found by clang's new Wheader-guard.
thakis@chromium.org [Mon, 17 Jun 2013 23:48:04 +0000 (23:48 +0000)]
Fix wrong header guards found by clang's new Wheader-guard.

Example diagnostic:

In file included from ../../ppapi/tests/test_flash_file.cc:5:
../../ppapi/tests/test_flash_file.h:5:9: error: 'PAPPI_TESTS_TEST_FLASH_FILE_H_' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../ppapi/tests/test_flash_file.h:6:9: note: 'PPAPI_TESTS_TEST_FLASH_FILE_H_' is defined here; did you mean 'PAPPI_TESTS_TEST_FLASH_FILE_H_'?

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        PAPPI_TESTS_TEST_FLASH_FILE_H_
1 error generated.

BUG=none
R=ben@chromium.org

Review URL: https://codereview.chromium.org/17321002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206837 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days agoAdd support using EXPECT_EQ with NullableString16 objects.
darin@chromium.org [Mon, 17 Jun 2013 21:36:41 +0000 (21:36 +0000)]
Add support using EXPECT_EQ with NullableString16 objects.

Change the default constructor to set is_null_ to true.  This makes NullableString16 act more like a WebKit::WebString, which is really the reason NullableString16 exists at all.

R=brettw@chromium.org

Review URL: https://codereview.chromium.org/17289005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206805 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days agoCurrently, the temporary directory name is generated by rand(), which was seeded...
tommycli@chromium.org [Mon, 17 Jun 2013 21:06:33 +0000 (21:06 +0000)]
Currently, the temporary directory name is generated by rand(), which was seeded with the number of seconds since Epoch. This was flaky when many directories were generated within a second, such as within a unit test.

This fix changes it to use base::rand_util.

BUG=NONE

Review URL: https://chromiumcodereview.appspot.com/15479003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206796 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days agoFix LeakSanitizer annotations for NaCl.
earthdok@chromium.org [Mon, 17 Jun 2013 19:08:06 +0000 (19:08 +0000)]
Fix LeakSanitizer annotations for NaCl.

NaCl code is not built with LSan runtime, so annotations should not be used.

R=glider@chromium.org, jar@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16845006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206766 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days agoFixing issue of invalid number of parameters. Found this issue while debugging report...
shrikant@chromium.org [Mon, 17 Jun 2013 18:00:45 +0000 (18:00 +0000)]
Fixing issue of invalid number of parameters. Found this issue while debugging reported crash. This could be likely cause of the crash, which is not repro at this time on my VM with outlined steps.

To test fixed issue:
Open chrome in metro mode with a html page which shows notification like following.
  var notification = webkitNotifications.createNotification("", "Notification Created", "Notification created", "");
  notification.show();

BUG=240260
Test=As outlined in description above.
R=cpu,ananta,dewittj

Review URL: https://chromiumcodereview.appspot.com/16865017

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206750 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 days ago[Android] Call View.postInvalidate on ICS
boliu@chromium.org [Mon, 17 Jun 2013 17:50:55 +0000 (17:50 +0000)]
[Android] Call View.postInvalidate on ICS

Since we are calling postInvalidateOnAnimation on JB+, a better match on
ICS would be to call postInvalidate instead of the more synchronous
invalidate.

BUG=

Review URL: https://chromiumcodereview.appspot.com/17092002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206746 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoRevert 206507 "Move message_pump to base/message_loop."
brettw@chromium.org [Fri, 14 Jun 2013 23:15:32 +0000 (23:15 +0000)]
Revert 206507 "Move message_pump to base/message_loop."

> Move message_pump to base/message_loop.
>
> This also fixes some namespace usage inside the message pump files and updates all users of these files to use the new location.
>
> BUG=
> R=sky@chromium.org
>
> Review URL: https://codereview.chromium.org/17078005

TBR=brettw@chromium.org

Review URL: https://codereview.chromium.org/16897005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206513 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoMove message_pump to base/message_loop.
brettw@chromium.org [Fri, 14 Jun 2013 22:51:28 +0000 (22:51 +0000)]
Move message_pump to base/message_loop.

This also fixes some namespace usage inside the message pump files and updates all users of these files to use the new location.

BUG=
R=sky@chromium.org

Review URL: https://codereview.chromium.org/17078005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206507 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoAdds RefCountedDeleteOnMessageLoop
droger@chromium.org [Fri, 14 Jun 2013 18:03:03 +0000 (18:03 +0000)]
Adds RefCountedDeleteOnMessageLoop

RefCountedDeleteOnMessageLoop is similar to RefCountedThreadSafe, but guarantees that
the referenced object will be deleted on the specified loop.
The functionality is similar to content::DeleteOnThread<> but does not depend on
BrowserThread.

The CL includes an example use of the class.

BUG=248049
TBR=stuartmorgan, joth

Review URL: https://chromiumcodereview.appspot.com/16938006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206445 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoMake base compile with no "using base::Value" in values.h
brettw@chromium.org [Fri, 14 Jun 2013 17:56:08 +0000 (17:56 +0000)]
Make base compile with no "using base::Value" in values.h

This adds explicit namespace to a bunch of places.

BUG=
R=avi@chromium.org

Review URL: https://codereview.chromium.org/16797003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206440 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoFix grammar in recurring macro comment
janx@chromium.org [Fri, 14 Jun 2013 13:00:22 +0000 (13:00 +0000)]
Fix grammar in recurring macro comment

Trivial patch changing "generate enum" to "generate enum values" in comments
justifying the lack of include guards in xmacro value lists.

NOTRY=true
TBR=yfriedman,atwilson,gavinp

Review URL: https://chromiumcodereview.appspot.com/16147015

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206405 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 days agoUpdate CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*"
rsleevi@chromium.org [Fri, 14 Jun 2013 07:30:38 +0000 (07:30 +0000)]
Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*"

BUG=110610
TBR=darin

Review URL: https://chromiumcodereview.appspot.com/16998003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206357 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoMove message_loop to the message_loop directory.
brettw@chromium.org [Fri, 14 Jun 2013 03:27:49 +0000 (03:27 +0000)]
Move message_loop to the message_loop directory.

Keep a forwarding header to avoid updating all callers.

BUG=
TBR=avi

Review URL: https://chromiumcodereview.appspot.com/15682017

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206279 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoAdd LeakSanitizer annotations to base/debug/leak_annotations.h
earthdok@google.com [Thu, 13 Jun 2013 22:30:33 +0000 (22:30 +0000)]
Add LeakSanitizer annotations to base/debug/leak_annotations.h

If building with LeakSanitizer, define leak annotations appropriately.
http://clang.llvm.org/docs/LeakSanitizer.html

R=glider@chromium.org,jar@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15652009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206167 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoRewrite scoped_ptr<T>(NULL) to use the default ctor in base/.
dcheng@chromium.org [Thu, 13 Jun 2013 18:01:07 +0000 (18:01 +0000)]
Rewrite scoped_ptr<T>(NULL) to use the default ctor in base/.

This is the result of running the rewrite_scoped_ptr_ctor_null tool
across all files built on Linux in the base/ directory.

BUG=173286

Review URL: https://chromiumcodereview.appspot.com/16950008

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206116 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoNotify TraceLog observers outside of the lock
jamescook@chromium.org [Thu, 13 Jun 2013 17:44:56 +0000 (17:44 +0000)]
Notify TraceLog observers outside of the lock

This allows observers to call code that uses TRACE_EVENT macros.

BUG=none, noticed while developing memory tracing patch
TEST=Added to base_unittests TraceEventTestFixture

Review URL: https://chromiumcodereview.appspot.com/16829002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206109 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoMove nullable_string16.h to the string subdirectory.
avi@chromium.org [Thu, 13 Jun 2013 13:47:46 +0000 (13:47 +0000)]
Move nullable_string16.h to the string subdirectory.

BUG=247723
TEST=no change
TBR=brettw@chromium.org

Review URL: https://codereview.chromium.org/16415016

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206066 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 days agoadd more string -> unsigned number conversion unit tests (attempt 2)
mostynb@opera.com [Thu, 13 Jun 2013 09:04:38 +0000 (09:04 +0000)]
add more string -> unsigned number conversion unit tests (attempt 2)

Add unit tests for the following functions in base:
StringToUint
StringToUint64
StringToSizeT

Review URL: https://chromiumcodereview.appspot.com/15521004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@206031 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days ago[Android] Fix component build again.
yfriedman@chromium.org [Wed, 12 Jun 2013 20:54:28 +0000 (20:54 +0000)]
[Android] Fix component build again.

After this, android_clang_dbg (tree-closer) will be switched to use components.
BUG=247855

Review URL: https://chromiumcodereview.appspot.com/15942017

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205926 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days agoRevert "GTTF: Lower the action max timeout to 30s for everyone."
phajdan.jr@chromium.org [Wed, 12 Jun 2013 16:40:16 +0000 (16:40 +0000)]
Revert "GTTF: Lower the action max timeout to 30s for everyone."

TBR=sky

BUG=none

Review URL: https://codereview.chromium.org/15663007

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205819 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days agoAdds MemoryPressureListener.
bulach@chromium.org [Wed, 12 Jun 2013 15:33:47 +0000 (15:33 +0000)]
Adds MemoryPressureListener.

Some platforms, like android, send clear signals when
under memory pressure.
Create a centralized place so that:
- Underlying platform can advise the rest of the system of
its memory status.
- Individual subsystems can then listen to such notifications
and free their memory as per their own policies.

BUG=246125

Review URL: https://chromiumcodereview.appspot.com/15995014

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205796 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days ago[Autofill] Determine Popup RTLness from page
csharp@chromium.org [Wed, 12 Jun 2013 15:32:31 +0000 (15:32 +0000)]
[Autofill] Determine Popup RTLness from page

Have the Autofill popup determine if it is RTL based on the element
it is a popup for, instead of just following the RTL setting of the UI.

BUG=238055

Review URL: https://chromiumcodereview.appspot.com/15769018

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205795 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days agoFix aligned_memory_unittest for x86-64 NaCl
hamaji@chromium.org [Wed, 12 Jun 2013 13:31:24 +0000 (13:31 +0000)]
Fix aligned_memory_unittest for x86-64 NaCl

NaCl SFI on x86-64 does not allow programs to align stack
to >128 byte boundaries. Technically NaCl may be able to
allow bigger alignments and I think current specification
is decided just because it's easy to implement a validator.
(the size of operand will be bigger for >128 byte alignment)
We may not want to align stack to >128 byte boundaries anyway,
so let's just disable this test.

BUG=

Review URL: https://chromiumcodereview.appspot.com/15943005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205755 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 days agoRename base/hash_tables to base/containers/hash_tables.
brettw@chromium.org [Tue, 11 Jun 2013 17:52:44 +0000 (17:52 +0000)]
Rename base/hash_tables to base/containers/hash_tables.

Remove forwarding header

BUG=
R=avi@chromium.org

Review URL: https://codereview.chromium.org/16667019

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205584 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 days agoCall scoped_refptr<T>::get() rather than relying on implicit "operator T*"
rsleevi@chromium.org [Tue, 11 Jun 2013 16:46:36 +0000 (16:46 +0000)]
Call scoped_refptr<T>::get() rather than relying on implicit "operator T*"

This upates calls to bound temporary objects to also use get().
While it has the same semantic equivalence to the existing code, this generally
represents a dangerous pattern - indeed, part of the whole motivation for this
change is to make this anti-pattern very visible to authors.

This change simply updates all of the call sites, to allow the "operator T*"
to be removed and preventing new instances. The existing instances will then be
reviewed for "suspicious" changes and updated to use/pass scoped_refptr<T>
rather than T*, as appropriate.

BUG=110610
TBR=darin

Review URL: https://codereview.chromium.org/15984016

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205560 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 days agoUse a direct include of strings headers in base/.
avi@chromium.org [Tue, 11 Jun 2013 13:36:37 +0000 (13:36 +0000)]
Use a direct include of strings headers in base/.

BUG=247723
TEST=none
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16745002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205530 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 days agoRegister a unique window class for every instance of base::MessagePumpForUI (Windows).
alexeypa@chromium.org [Tue, 11 Jun 2013 12:30:08 +0000 (12:30 +0000)]
Register a unique window class for every instance of base::MessagePumpForUI (Windows).

Currently each base::MessagePumpForUI object registers a window class with a predefined name. This leads to races when more than one UI pump is created. This CL addresses this issue by generating a unique class name for every base::MessagePumpForUI object.

BUG=241939

Review URL: https://chromiumcodereview.appspot.com/16402011

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205506 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoMake CreateDirectory return an error code instead of just a bool.
dgrogan@chromium.org [Tue, 11 Jun 2013 03:50:25 +0000 (03:50 +0000)]
Make CreateDirectory return an error code instead of just a bool.

Make use of the new error code in IndexedDB, where we'll
histogram which errors can be recovered from by retrying
and which can't.

We're going to try retrying CreateDirectory because LevelDB
doesn't pay attention to what env_->CreateDir returns and a
frequent error on the next operation (locking the lock file)
is that the directory doesn't exist. I want to find out
what's causing the directories to not be created in the
first place, and which errors can be considered ephemeral.

BUG=225051

Review URL: https://chromiumcodereview.appspot.com/15812007

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205386 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoReenable the tcmalloc SecurityTests in base_unittests on Windows
wfh@chromium.org [Mon, 10 Jun 2013 23:48:49 +0000 (23:48 +0000)]
Reenable the tcmalloc SecurityTests in base_unittests on Windows

These tests now function correctly because base_unittests now is built with allocator_shims - see http://crrev.com/15674003/

BUG=242304

Review URL: https://chromiumcodereview.appspot.com/16077014

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205350 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoFix leak in WeakPtrTest::NonOwnerThreadCanCopyAndAssignWeakPtr{,Base}
akalin@chromium.org [Mon, 10 Jun 2013 23:46:15 +0000 (23:46 +0000)]
Fix leak in WeakPtrTest::NonOwnerThreadCanCopyAndAssignWeakPtr{,Base}

The leak was caused by DeleteArrow() not being called.

BUG=179758
R=jar@chromium.org

Review URL: https://codereview.chromium.org/15797010

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205345 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoUse a direct include of strings headers in base/.
avi@chromium.org [Mon, 10 Jun 2013 21:17:40 +0000 (21:17 +0000)]
Use a direct include of strings headers in base/.

BUG=247723
TEST=none
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16344006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205309 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoUpdate includes of message_loop_proxy.
brettw@chromium.org [Mon, 10 Jun 2013 20:56:28 +0000 (20:56 +0000)]
Update includes of message_loop_proxy.

This keeps the forwarding header, just updates all current callers.

BUG=
R=avi@chromium.org

Review URL: https://codereview.chromium.org/16514006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205306 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoUse a direct include of strings headers in base/.
avi@chromium.org [Mon, 10 Jun 2013 20:11:14 +0000 (20:11 +0000)]
Use a direct include of strings headers in base/.

BUG=247723
TEST=none
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16320009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205284 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoGTTF: Lower the action max timeout to 30s for everyone.
phajdan.jr@chromium.org [Mon, 10 Jun 2013 19:32:01 +0000 (19:32 +0000)]
GTTF: Lower the action max timeout to 30s for everyone.

Slow tests are slow.

BUG=none
R=sky@chromium.org

Review URL: https://codereview.chromium.org/15901017

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205276 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoUse a direct include of strings headers in base/.
avi@chromium.org [Mon, 10 Jun 2013 19:06:57 +0000 (19:06 +0000)]
Use a direct include of strings headers in base/.

BUG=247723
TEST=none
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16667013

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205261 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoMove hash_tables.h to base/containers.
brettw@chromium.org [Mon, 10 Jun 2013 17:50:33 +0000 (17:50 +0000)]
Move hash_tables.h to base/containers.

This keeps a fowrarding header to keep the change small.

BUG=
R=avi@chromium.org

Review URL: https://codereview.chromium.org/16160022

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205241 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agomac: Move more 10.7 api stuff into sdk_forward_declarations.h
thakis@chromium.org [Mon, 10 Jun 2013 17:12:48 +0000 (17:12 +0000)]
mac: Move more 10.7 api stuff into sdk_forward_declarations.h

BUG=none
TBR=mark@chromium.org

Review URL: https://codereview.chromium.org/15870009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205234 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoAdd an "append flag" to base::PlatformFile.
teravest@chromium.org [Mon, 10 Jun 2013 15:28:09 +0000 (15:28 +0000)]
Add an "append flag" to base::PlatformFile.

PLATFORM_FILE_APPEND is exclusive with PLATFORM_FILE_WRITE. This is because on Windows, if we were to apply both flags, the behavior would not be consistent with O_APPEND.

On Posix, PLATFORM_FILE_APPEND provides O_APPEND, and either O_WRONLY or O_RDWR, depending on other flags.

On Windows, PLATFORM_FILE_APPEND provides FILE_APPEND_DATA, and fails to create the plaform file if PLATFORM_FILE_WRITE is also passed.

BUG=242383

Review URL: https://chromiumcodereview.appspot.com/15861011

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205217 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoImprove the implementation of atomic operations on Linux/ARM (including Android/ARM).
digit@chromium.org [Mon, 10 Jun 2013 14:00:06 +0000 (14:00 +0000)]
Improve the implementation of atomic operations on Linux/ARM (including Android/ARM).

The previous patch at:

    https://chromiumcodereview.appspot.com/10831358

actually regressed the performance of atomic operations on Linux/ARM systems, because
the GCC intrinsics (e.g. __sync_fetch_and_add) are very poorly implemented at the
moment (and also always provide a full barrier, even when the caller doesn't need it).

This replaces the implementation with a better version which:

- Uses inline assembly and LDRES/STREX instructions on ARMv6+, or the old
  kernel helper cmpxchg implementation on ARMv5.

- Still uses the kernel helper memory barrier to optimize for single core
  devices on ARMv6 and ARMv7, or ARMv5 binaries running on devices with
  a higher architecture number.

- Provide truly barrier free compare-and-swap, swap and atomic-inc
  operations.

On tested Android/ARM devices, this speeds up atomic increments by x2 to x3.
This indirectly speeds up other operations relying on it (e.g. scoped_refptr<>
or base::Bind()). For details, see:

  https://docs.google.com/a/chromium.org/spreadsheet/ccc?key=0Arp73PHrzcIQdGNUd1NGYWlfY0dKWS1EZ2V6RThhZXc&usp=sharing

BUG=234215

Review URL: https://chromiumcodereview.appspot.com/16335007

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205205 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoAnnotate the intentional test-only leak in base/tracked_objects.cc.
earthdok@google.com [Mon, 10 Jun 2013 11:32:20 +0000 (11:32 +0000)]
Annotate the intentional test-only leak in base/tracked_objects.cc.
Remove several HeapChecker suppressions in favor of one annotation.

BUG=136936
R=jar@chromium.org
CC=glider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16387012

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205190 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 days agoProvide nanoseconds precision for base::PlatformFileInfo on POSIX
apavlov@chromium.org [Mon, 10 Jun 2013 09:41:35 +0000 (09:41 +0000)]
Provide nanoseconds precision for base::PlatformFileInfo on POSIX

BUG=244430

Review URL: https://chromiumcodereview.appspot.com/16093026

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205178 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

10 days agoRedo r203907 base_unittests.exe to use alloactor shims
wfh@chromium.org [Sun, 9 Jun 2013 12:57:38 +0000 (12:57 +0000)]
Redo r203907 base_unittests.exe to use alloactor shims

Previous commit r203907 broke VS2012 build because in VS7.1, the new array operator is now in newaopnt.obj and not newopnt.obj.

This commit modifies prep_libc.py to correctly pull the newaopnt.obj from libcmt.lib so there is no symbol clash.

See also crrev.com/15674003 and crrev.com/16154020

BUG=242304

Review URL: https://chromiumcodereview.appspot.com/15979023

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205115 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

11 days agoDisable ProcessUtilTest.CalcFreeMemory total memory test when using tcmalloc.
wfh@chromium.org [Sat, 8 Jun 2013 23:57:24 +0000 (23:57 +0000)]
Disable ProcessUtilTest.CalcFreeMemory total memory test when using tcmalloc.

This is because tcmalloc has an allocation strategy that sometimes causes this test to be flaky when it's enabled for base_unittests.

BUG=247398

Review URL: https://chromiumcodereview.appspot.com/16634009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205088 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoMove string files in base/ to the string subdirectory.
avi@chromium.org [Sat, 8 Jun 2013 06:05:47 +0000 (06:05 +0000)]
Move string files in base/ to the string subdirectory.

BUG=247723
TEST=no change

Review URL: https://chromiumcodereview.appspot.com/16331011

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205050 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoGetProcId shouldn't always upgrade the supplied handle
jschuh@chromium.org [Sat, 8 Jun 2013 04:54:07 +0000 (04:54 +0000)]
GetProcId shouldn't always upgrade the supplied handle

We should use the handle we're given.

TBR=brettw

Review URL: https://chromiumcodereview.appspot.com/15837005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205020 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoMove FileEnumerator to its own file, do some refactoring.
brettw@chromium.org [Sat, 8 Jun 2013 04:53:36 +0000 (04:53 +0000)]
Move FileEnumerator to its own file, do some refactoring.

It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked.

BUG=175002

Reland of 198820 and 298824
Original review = https://codereview.chromium.org/13165005
R=rvargas@chromium.org

Review URL: https://codereview.chromium.org/16392011

git-svn-id: http://src.chromium.org/svn/trunk/src/base@205019 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoAnnotate LeakyLazyInstance as a leak. Remove HeapChecker suppressions.
earthdok@google.com [Fri, 7 Jun 2013 22:09:32 +0000 (22:09 +0000)]
Annotate LeakyLazyInstance as a leak. Remove HeapChecker suppressions.

The two suppressions removed by this CL have not fired for a long time,
for some unknown reason. It's still a good idea to annotate all
intentional leaks though.

BUG=83345
R=jar@chromium.org,darin@chromium.org
CC=glider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/16440006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204953 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoUse a direct include of utf_string_conversions.h in android_webview/, apps/, ash...
avi@chromium.org [Fri, 7 Jun 2013 18:37:07 +0000 (18:37 +0000)]
Use a direct include of utf_string_conversions.h in android_webview/, apps/, ash/, base/.

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/15735027

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204874 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoAdd a path to use CALayers to display content
ccameron@chromium.org [Fri, 7 Jun 2013 15:20:18 +0000 (15:20 +0000)]
Add a path to use CALayers to display content

Add the flag --use-core-animation to enable this path.

Make the RenderWidgetHostViewCocoa layer-backed, and add a
default white layer.

Add a CALayer, softwareLayer_ to draw into when the accelerated
path is disabled. Update the software draw methods to use the CG
calls (this changes the non-CA path as well, but should be equivalent
to previous behavior).

If accelerated compositing is enabled, then add CAOpenGLLayer to
draw accelerated frames (frames using IOSurfaces). If we receive a
software frame, then delete this layer (and the software layer will
appear below it).

This still has a number of issues to resolve before enabling, including
- corrupted bookmark bars
- increased CPU usage (3.5%->5% without compositing, 7%->10% with)
- increased startup time

BUG=245900
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/16189012

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204841 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 days agoAnnotate the intentional leak in weak_ptr_unittest.cc.
earthdok@google.com [Fri, 7 Jun 2013 14:32:23 +0000 (14:32 +0000)]
Annotate the intentional leak in weak_ptr_unittest.cc.

Remove the corresponding suppressions.

BUG=179758
R=akalin@chromium.org,darin@chromium.org
CC=glider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15848016

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204833 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days ago[MIPS] Fix memory barriers for atomic operations.
paul.lind@imgtec.com [Fri, 7 Jun 2013 02:31:16 +0000 (02:31 +0000)]
[MIPS] Fix memory barriers for atomic operations.

Add barriers using MIPS 'sync' instructions as needed for SMP
systems.

BUG=246947

Review URL: https://chromiumcodereview.appspot.com/16001009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204697 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoReland: Fix errors when building android with coverage=1
ilevy@chromium.org [Thu, 6 Jun 2013 23:49:26 +0000 (23:49 +0000)]
Reland: Fix errors when building android with coverage=1

Originally landed in r204547
Reverted in r204553 due to cq anomaly.

Android builds with coverage=1 fail due to uninitialized variable
warnings in base/linux_util.cc and base/net/net_util.cc

BUG=245467
TBR=willchan

Review URL: https://chromiumcodereview.appspot.com/16589002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204662 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoAndroid: Provide futimes() implementation using utimensat()
nileshagrawal@chromium.org [Thu, 6 Jun 2013 22:42:47 +0000 (22:42 +0000)]
Android: Provide futimes() implementation using utimensat()

The earlier implementation using /proc/self/fd/<num> failed when called from a non-main thread in production builds of Chrome and Android.

Depends on NDK r8e: https://codereview.chromium.org/14860010/

BUG=236403

Review URL: https://chromiumcodereview.appspot.com/14649009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204633 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoAdd isLayoutRtl() to ApiCompatibilityUtils.java.
newt@chromium.org [Thu, 6 Jun 2013 20:54:45 +0000 (20:54 +0000)]
Add isLayoutRtl() to ApiCompatibilityUtils.java.

This addresses the possible bug with using getLayoutDirection() on
pre-JB MR1 devices mentioned in http://crbug.com/245224#c6

BUG=245224
R=yfriedman@chromium.org

Review URL: https://codereview.chromium.org/16596002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204587 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoRevert 204556 "Fix errors when building android with coverage=1"
ilevy@chromium.org [Thu, 6 Jun 2013 20:00:27 +0000 (20:00 +0000)]
Revert 204556 "Fix errors when building android with coverage=1"

CQ anomaly x2.

> Fix errors when building android with coverage=1
>
> Android builds with coverage=1 fail due to uninitialized variable
> warnings in base/linux_util.cc and base/net/net_util.cc
>
> BUG=245467
>
> Review URL: https://chromiumcodereview.appspot.com/16077010

TBR=rwalker@codeaurora.org

Review URL: https://codereview.chromium.org/16505004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204562 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoFix errors when building android with coverage=1
rwalker@codeaurora.org [Thu, 6 Jun 2013 19:49:17 +0000 (19:49 +0000)]
Fix errors when building android with coverage=1

Android builds with coverage=1 fail due to uninitialized variable
warnings in base/linux_util.cc and base/net/net_util.cc

BUG=245467

Review URL: https://chromiumcodereview.appspot.com/16077010

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204556 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoRevert 204547 "Fix errors when building android with coverage=1"
ilevy@chromium.org [Thu, 6 Jun 2013 19:10:37 +0000 (19:10 +0000)]
Revert 204547 "Fix errors when building android with coverage=1"

CQ error.  Committed without tryjobs.

> Fix errors when building android with coverage=1
>
> Android builds with coverage=1 fail due to uninitialized variable
> warnings in base/linux_util.cc and base/net/net_util.cc
>
> BUG=245467
>
> Review URL: https://chromiumcodereview.appspot.com/16077010

TBR=rwalker@codeaurora.org

Review URL: https://codereview.chromium.org/16415008

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204553 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoFix errors when building android with coverage=1
rwalker@codeaurora.org [Thu, 6 Jun 2013 18:58:44 +0000 (18:58 +0000)]
Fix errors when building android with coverage=1

Android builds with coverage=1 fail due to uninitialized variable
warnings in base/linux_util.cc and base/net/net_util.cc

BUG=245467

Review URL: https://chromiumcodereview.appspot.com/16077010

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204547 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

13 days agoUpstream ApiCompatibilityUtils.java.
newt@chromium.org [Thu, 6 Jun 2013 13:41:08 +0000 (13:41 +0000)]
Upstream ApiCompatibilityUtils.java.

This also merges in DeprecationUtilities, whose function is closely related.

BUG=245224
R=aurimas@chromium.org, kkimlabs@chromium.org, yfriedman@chromium.org

Review URL: https://codereview.chromium.org/16093035

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204491 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoMake expressions like "if (weak_ptr)" work
akalin@chromium.org [Thu, 6 Jun 2013 05:32:37 +0000 (05:32 +0000)]
Make expressions like "if (weak_ptr)" work

Use the same trick as scoped_ptr<T>.

Add comments regarding == and != operators and their relation to
the bool trick.

BUG=245942
R=darin@chromium.org, rsleevi@chromium.org

Review URL: https://codereview.chromium.org/15721007

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204438 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRemove WeakPtr<T>'s operator T*()
akalin@chromium.org [Thu, 6 Jun 2013 01:27:48 +0000 (01:27 +0000)]
Remove WeakPtr<T>'s operator T*()

BUG=245942
R=darin@chromium.org

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204293

Review URL: https://chromiumcodereview.appspot.com/16267003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204379 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRevert 200327 to allocator.gyp to disable debugallocator on Windows
wfh@chromium.org [Wed, 5 Jun 2013 19:43:32 +0000 (19:43 +0000)]
Revert 200327 to allocator.gyp to disable debugallocator on Windows

BUG=246933
TBR=jar@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15949018

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204319 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRevert 204293 "Remove WeakPtr<T>'s operator T*()"
kkania@chromium.org [Wed, 5 Jun 2013 19:33:14 +0000 (19:33 +0000)]
Revert 204293 "Remove WeakPtr<T>'s operator T*()"

broke linux chromeos compile:

chromeos-chrome-29.0.1530.0_alpha-r1: content/common/gpu/media/exynos_video_decode_accelerator.cc: In member function 'void content::ExynosVideoDecodeAccelerator::NotifyError(media::VideoDecodeAccelerator::Error)':
chromeos-chrome-29.0.1530.0_alpha-r1: content/common/gpu/media/exynos_video_decode_accelerator.cc:1894:14: error: could not convert '((content::ExynosVideoDecodeAccelerator*)this)->content::ExynosVideoDecodeAccelerator::client_' from 'base::WeakPtr<media::VideoDecodeAccelerator::Client>' to 'bool'
...more errors

> Remove WeakPtr<T>'s operator T*()
>
> BUG=245942
> R=darin@chromium.org
>
> Review URL: https://codereview.chromium.org/16267003

TBR=akalin@chromium.org

Review URL: https://codereview.chromium.org/16229012

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204315 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRemove WeakPtr<T>'s operator T*()
akalin@chromium.org [Wed, 5 Jun 2013 18:01:23 +0000 (18:01 +0000)]
Remove WeakPtr<T>'s operator T*()

BUG=245942
R=darin@chromium.org

Review URL: https://codereview.chromium.org/16267003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204293 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoFix even more remaining uses of WeakPtr<T>'s operator T* conversion
akalin@chromium.org [Tue, 4 Jun 2013 20:54:20 +0000 (20:54 +0000)]
Fix even more remaining uses of WeakPtr<T>'s operator T* conversion

These cases weren't caught by the automated pass and/or needed to be
solved in another way than using .get().

BUG=245942
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/16226028

git-svn-id: http://src.chromium.org/svn/trunk/src/base@204036 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoFix remaining uses of WeakPtr<T>'s operator T* conversion
akalin@chromium.org [Tue, 4 Jun 2013 17:35:13 +0000 (17:35 +0000)]
Fix remaining uses of WeakPtr<T>'s operator T* conversion

These cases weren't caught by the automated pass and/or needed
to be solved in another way than using .get().

BUG=245942
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/16207005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203996 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRevert 203907 "Modify base_unittests.exe to use the allocator shims"
jochen@chromium.org [Tue, 4 Jun 2013 10:38:18 +0000 (10:38 +0000)]
Revert 203907 "Modify base_unittests.exe to use the allocator shims"

Fails to compile:

88>allocator.lib(allocator_shim.obj) :error LNK2005: "void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)" (??_U@YAPAXIABUnothrow_t@std@@@Z) already defined in libcmt.lib(newaopnt.obj)
88>..\build\Release\base_unittests.exe : fatalerror LNK1169: one or more multiply defined symbols found

> Modify base_unittests.exe to use the allocator shims
> required to use tcmalloc on Windows.
>
> This fixes failing SecurityTest.MemoryAllocationRestriction
> tests which are testing the tcmalloc 2Gb memory limits
> imposed for security
>
> BUG=242304
>
> Review URL: https://chromiumcodereview.appspot.com/15674003

TBR=wfh@chromium.org

Review URL: https://codereview.chromium.org/16154020

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203911 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoModify base_unittests.exe to use the allocator shims
wfh@chromium.org [Tue, 4 Jun 2013 08:38:21 +0000 (08:38 +0000)]
Modify base_unittests.exe to use the allocator shims
required to use tcmalloc on Windows.

This fixes failing SecurityTest.MemoryAllocationRestriction
tests which are testing the tcmalloc 2Gb memory limits
imposed for security

BUG=242304

Review URL: https://chromiumcodereview.appspot.com/15674003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203907 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoposix thread: Attempt to set audio threads to real time.
dgreid@chromium.org [Tue, 4 Jun 2013 07:26:51 +0000 (07:26 +0000)]
posix thread: Attempt to set audio threads to real time.

Set the scheduling class of audio threads to SCHED_RR if possible.  If
not, fall back to setting the nice level.  Setting the thread to
real time helps when playing/recording low latency audio.  Also
changing the scheduler keeps audio threads from being limited by
bandwidth limits placed on background tabs, those apply to SCHED_OTHER
threads only.  The rest of the process will be limited by these, only
the audio threads will have high priority.

This still isn't perfect, youtube will occasionally glitch on arm,
either because of video decode or maybe a thread audio is dependent on
that isn't real time.

BUG=chromium:213118
TEST=check audio thread priorities with ps, see that they are set.
Play audio from grooveshark or youtube in the background while loading
other tabs and listen for dropouts.

Review URL: https://chromiumcodereview.appspot.com/15203009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203896 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoAdd TRACE_EVENT_IS_NEW_TRACE as a way to snapshot objects at start of recording
nduca@chromium.org [Tue, 4 Jun 2013 01:31:52 +0000 (01:31 +0000)]
Add TRACE_EVENT_IS_NEW_TRACE as a way to snapshot objects at start of recording

R=dsinclair,enne
NOTRY=True

Android test failures are flake.

Review URL: https://chromiumcodereview.appspot.com/15774010

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203810 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoUpdate base/ to use WeakPtr<T>::get() instead of implicit "operator T*"
akalin@chromium.org [Mon, 3 Jun 2013 22:15:21 +0000 (22:15 +0000)]
Update base/ to use WeakPtr<T>::get() instead of implicit "operator T*"

BUG=245942
TBR=ajwong@chromium.org

Review URL: https://codereview.chromium.org/15836004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203782 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoRemove "using base::MessageLoop" from message_loop.h.
xhwang@google.com [Sat, 1 Jun 2013 11:41:24 +0000 (11:41 +0000)]
Remove "using base::MessageLoop" from message_loop.h.

TBR=thestig@chromium.org
BUG=236029
TEST=none

Review URL: https://codereview.chromium.org/15660015

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203599 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoFix leak in WeakPtr test introduced in r202038, and remove suppression.
wez@chromium.org [Sat, 1 Jun 2013 01:19:39 +0000 (01:19 +0000)]
Fix leak in WeakPtr test introduced in r202038, and remove suppression.

TBR=darin
BUG=243757,232143

Review URL: https://chromiumcodereview.appspot.com/16035004

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203547 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoUpdate base/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
rsleevi@chromium.org [Fri, 31 May 2013 21:37:53 +0000 (21:37 +0000)]
Update base/ to use scoped_refptr<T>::get() rather than implicit "operator T*"

Linux fixes

BUG=110610
TBR=darin

Review URL: https://chromiumcodereview.appspot.com/16160015

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203483 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoSplit ProcessIterator and friends out of base/process_util.h into base/process/proces...
rsesek@chromium.org [Fri, 31 May 2013 15:38:01 +0000 (15:38 +0000)]
Split ProcessIterator and friends out of base/process_util.h into base/process/process_iterator.h.

BUG=242290
R=brettw@chromium.org

Review URL: https://codereview.chromium.org/15806006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203412 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoCleanup: Fix some silly syntax in LibDispatchTaskRunnerTest.
thestig@chromium.org [Fri, 31 May 2013 07:27:24 +0000 (07:27 +0000)]
Cleanup: Fix some silly syntax in LibDispatchTaskRunnerTest.

Review URL: https://chromiumcodereview.appspot.com/16129005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203357 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoUse base::MessageLoop in more files.
xhwang@chromium.org [Thu, 30 May 2013 23:11:04 +0000 (23:11 +0000)]
Use base::MessageLoop in more files.

These are either missed in the first pass, or added after the first pass.

TBR=thestig@chromium.org
BUG=236029

Review URL: https://codereview.chromium.org/16092013

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203259 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks ago[Mac] Move the large block of NSEvent forward declarations to a shared header.
rsesek@chromium.org [Thu, 30 May 2013 16:09:14 +0000 (16:09 +0000)]
[Mac] Move the large block of NSEvent forward declarations to a shared header.

BUG=none
R=mark@chromium.org

Review URL: https://codereview.chromium.org/15979009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203155 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 weeks agoInclude stddef.h for the definition of size_t.
hans@chromium.org [Thu, 30 May 2013 12:48:54 +0000 (12:48 +0000)]
Include stddef.h for the definition of size_t.

These errors were caught by Clang.

BUG=82385

Review URL: https://chromiumcodereview.appspot.com/16196003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203136 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoMove latin1_string_conversions to base
abarth@chromium.org [Wed, 29 May 2013 23:21:30 +0000 (23:21 +0000)]
Move latin1_string_conversions to base

Unfortunately, we can't keep this function in webkit/glue because not everyone
who links in Blink depends on webkit/glue. For example, cc uses WebString but
doesn't depend on webkit/glue.

IMHO, the best solution to all these constraints is to put this function in
base. It's concerned with concepts that make sense in base (strings and
character sets). The only thing odd about the function is that it accepts
Latin-1 or UTF-16, which is because of the underlying string representation in
Blink.

Review URL: https://chromiumcodereview.appspot.com/15732022

git-svn-id: http://src.chromium.org/svn/trunk/src/base@203003 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoAllow chrome trace to be collected when atrace is enabled.
wangxianzhu@chromium.org [Wed, 29 May 2013 20:20:44 +0000 (20:20 +0000)]
Allow chrome trace to be collected when atrace is enabled.

Previously we chrome trace and atrace is exclusive. Sometimes this is
inconvenient.

BUG=244501

Review URL: https://chromiumcodereview.appspot.com/15892014

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202949 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoRevert 202639 "Use totmaps if available on chromeos"
davemoore@chromium.org [Wed, 29 May 2013 15:42:04 +0000 (15:42 +0000)]
Revert 202639 "Use totmaps if available on chromeos"

> Use totmaps if available on chromeos
>
> We currently use statm on linux. This provides less than great results.
> We take total resident memory and subtract "shared pages" from it instead of
> using a count of pages that only this process has mapped.
>
> On chromeos we've added totmaps which sums up the fields from the process'
> smaps.
>
> BUG=125150
> TEST=Examine memory reports from about:memory and task manager, and compare
>      them to the sums of the results in the smaps.
>
> R=thestig@chromium.org, willchan@chromium.org
>
> Review URL: https://codereview.chromium.org/15779007

TBR=davemoore@chromium.org

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202640

Review URL: https://codereview.chromium.org/16116003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202878 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoAndroid: allow JNI generator to be used with jarjar.
torne@chromium.org [Wed, 29 May 2013 13:51:23 +0000 (13:51 +0000)]
Android: allow JNI generator to be used with jarjar.

When using jarjar to rename Java packages to avoid name conflicts, the
generated JNI code no longer works as it refers to the old name. Support
using the jarjar remapping list during JNI generation to generate code
that refers to the post-remapping names, since the JNI headers are not
intended to be read by humans anyway.

BUG=

Review URL: https://chromiumcodereview.appspot.com/15715006

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202856 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoCleanup: Remove ScopedGenericObj. Use scoped_ptr<type, CustomDeleter> instead.
thestig@chromium.org [Wed, 29 May 2013 08:51:51 +0000 (08:51 +0000)]
Cleanup: Remove ScopedGenericObj. Use scoped_ptr<type, CustomDeleter> instead.

Review URL: https://chromiumcodereview.appspot.com/15848005

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202828 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoRemove all but one use of WeakPtrFactory::DetachFromThread.
wez@chromium.org [Wed, 29 May 2013 08:04:32 +0000 (08:04 +0000)]
Remove all but one use of WeakPtrFactory::DetachFromThread.

This is a re-land of issue 14299011, which broke GLSurfaceGLX, in turn breaking Chrome Linux/Aura.

This CL changes WeakPtr in the following ways:
* Changes thread-bindings semantics so that WeakPtrs only become bound when the first one is dereferenced, or the owning factory invalidates them.
* Removes WeakPtrFactory::DetachFromThread.
* Renames SupportsWeakPtr::DetachFromThread to DetachFromThreadHack.

Calling code changes to allow this:
* Unnecessary use of SupportsWeakPtr removed from SGIVideoSyncProviderThreadShim.
* Unnecessary DetachFromThread() calls removed from PluginInfoMessageFilter, DhcpProxyScript[Adapter]FetcherWin and (Chromoting's) PolicyWatcherLinux.
* DetachFromThread() calls rendered unnecessary by change in binding semantics removed from IOThread, SearchProviderInstallData, RuleRegistryWithCache and GLSurfaceGlx.

WebGraphicsContext3DInProcessCommandBufferImpl uses the re-named DetachFromThreadHack() - bug 234964 tracks work to remove that use.

TBR=darin,awong
BUG=232143, 234964, 243914

Review URL: https://chromiumcodereview.appspot.com/16007009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202811 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoDisable tcmalloc security tests on Windows
jschuh@chromium.org [Wed, 29 May 2013 03:05:33 +0000 (03:05 +0000)]
Disable tcmalloc security tests on Windows

BUG=242304
R=jln@chromium.org
TBR=jln@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15766009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202760 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agodrop unused execinfo.h header
vapier@chromium.org [Tue, 28 May 2013 22:09:03 +0000 (22:09 +0000)]
drop unused execinfo.h header

The execinfo.h header only provides prototypes for backtrace funcs.
These two files don't use those funcs, so the include is unused.
Punt it to make building on non-glibc systems easier.

BUG=None
TEST=trybot for linux/nacl/cros work

Review URL: https://chromiumcodereview.appspot.com/16120002

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202666 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoRevert 202639 "Use totmaps if available on chromeos"
davemoore@chromium.org [Tue, 28 May 2013 20:24:58 +0000 (20:24 +0000)]
Revert 202639 "Use totmaps if available on chromeos"

> Use totmaps if available on chromeos
>
> We currently use statm on linux. This provides less than great results.
> We take total resident memory and subtract "shared pages" from it instead of
> using a count of pages that only this process has mapped.
>
> On chromeos we've added totmaps which sums up the fields from the process'
> smaps.
>
> BUG=125150
> TEST=Examine memory reports from about:memory and task manager, and compare
>      them to the sums of the results in the smaps.
>
> R=thestig@chromium.org, willchan@chromium.org
>
> Review URL: https://codereview.chromium.org/15779007

TBR=davemoore@chromium.org

Review URL: https://codereview.chromium.org/16116003

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202640 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoUse totmaps if available on chromeos
davemoore@chromium.org [Tue, 28 May 2013 20:16:49 +0000 (20:16 +0000)]
Use totmaps if available on chromeos

We currently use statm on linux. This provides less than great results.
We take total resident memory and subtract "shared pages" from it instead of
using a count of pages that only this process has mapped.

On chromeos we've added totmaps which sums up the fields from the process'
smaps.

BUG=125150
TEST=Examine memory reports from about:memory and task manager, and compare
     them to the sums of the results in the smaps.

R=thestig@chromium.org, willchan@chromium.org

Review URL: https://codereview.chromium.org/15779007

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202639 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 weeks agoMove Thread Name Mapping into ThreadFunc.
dsinclair@chromium.org [Mon, 27 May 2013 16:37:39 +0000 (16:37 +0000)]
Move Thread Name Mapping into ThreadFunc.

This CL moves the setting and removal of the ThreadIdNameMapping into the ThreadFunc methods. This removes any potential race conditions around thread name removal as the thread will be live during both addition and removal.

BUG=238371

Review URL: https://chromiumcodereview.appspot.com/14634009

git-svn-id: http://src.chromium.org/svn/trunk/src/base@202446 4ff67af0-8c30-449e-8e8b-ad334ec8d88c