Fix PurgeableBuffer implementation.

The current implementation was making isPurgeable() return true when the memory
was actually not purgeable.

PurgeableBuffer::isPurgeable() was returning whether the instance was unlocked
or purged which is incorrect.
Discardable memory should have only two states: locked or unlocked. Whether the
memory was purged or not is an extra information provided upon lock() but it
should not replace the lock state.

The problem happened whenever the memory was evicted upon a lock (i.e.
m_memory->lock() returns false) and the instance transitioned to the PURGED
state (which is wrong) as opposed to LOCKED.
Calling isPurgeable() after that didn't tell whether the memory was purgeable
(since it's always locked after a lock() hence not purgeable) but rather
whether it was purged before the last lock which is not something that a user
of the API would expect.

This also changes isPurgeable() to isLocked() to match the lock() method and
forces clients to check the return value of lock().

Also note that purgeable memory can be deleted no matter which state it's in
(locked vs unlocked) so there is no need to conditionally unlock it at
destruction time.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164590 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Improve modules' TypeError exception messages.

BUG=270033

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164591 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[Not to land until https://codereview.chromium.org/101203006/ does]

Expose a cachePolicy parameter to loadHistoryItem.

In some cases, Chromium goes through the loadHistoryItem codepath to perform a
reload if the page to be reloaded isn't in this WebFrame (e.g., when reloading
a sad tab or during a session restore). Expose a cachePolicy parameter so the
embedder can override the default behavior (one of ReturnCacheDataElseLoad or
ReturnCacheDataDontLoad).

BUG=331386
TEST=WebFrameTest.LoadHistoryItemReload

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164592 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Pull OilPan's safe-point infrastructure from the branch to trunk.

R=ager@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164593 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add ch.dumez to several watchlists

Add ch.dumez to the dom, device_orientation and wtf watchlists.

R=abarth, eseidel
NOTRY=true
BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164594 bbb929c8-8fbe-4397-9dbb-9b2b20218538