Use mock temp file in profiler tests

Mock temp file implementation is used in all inspector tests instead of the real implementation based on temporary filesystem which (unlike temp fs in regular DevTools window) has limited quota which is often exceeded in the tests.

This should fix flakiness in the following tests:
inspector/profiler/heap-snapshot-loader.html
inspector/profiler/cpu-profiler-save-load.html

Also a bug in BufferedTempFileWriter.close was fixed.

TempFile.getFile was replaced with writeToOutputSteam which operates on types defined in DevTools and simplifies mocks.

BUG=330617,333860
R=alph@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165136 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Schedule session initialization in MediaKeys.

BUG=224786
TEST=none

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165137 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid parsing css text if there are identical inline style blocks.

(1) StyleEngine has two hashmaps, one is a mapping from css text to StyleSheetContents and the other is a mapping from StyleSheetContents to css text. When destroying StyleSheetContents, using the above mapping to remove css text.
The hashmaps are only for non-quirks document. Because non-quirks document cannot share styles with quirks document.
 
(2) made StyleSheetContents::checkLoaded to invoke new clients' sheetLoaded. To do so,
  (2-1) moved m_loadCompleted flag from StyleSheetContents to CSSStyleSheet,
  (2-2) added more "protect" to StyleSheetContents::checkLoaded to avoid CSSStyleSheet (i.e. client) and ownerNode being deleted by scripts, and
  (2-3) modified StyleSheetContents::loadCompleted() to see whether all clients completed loading.

(3) LinkStyle::setCSSStyleSheet should use StyleSheetContents' checkLoaded. Because now checkLoaded invokes only new clients' sheetLoaded. We don't need to directly invoke LinkStyle::sheetLoaded (this breaks m_loadCompleted flag and causes assertion failure). 

BUG=308781
TEST=all existing tests covers, so the tests should pass.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165139 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert of Revert of Never send a referrer header if the referrer is not a web url (https://codereview.chromium.org/133863003/)

Reason for revert:
Fixed the browser test meanwhile.

Original issue's description:
> Revert of Never send a referrer header if the referrer is not a web url (https://codereview.chromium.org/136583002/)
> 
> Reason for revert:
> This is the probable cause for the failing browser test CorrectReferrer. See:
> 
> http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests%20%28dbg%29/builds/1302/steps/browser_tests/logs/CorrectReferrer
> 
> http://build.chromium.org/p/chromium.webkit/builders/Mac10.8%20Tests/builds/5398/steps/browser_tests/logs/CorrectReferrer
> 
> http://build.chromium.org/p/chromium.webkit/builders/Win7%20Tests/builds/543/steps/browser_tests/logs/CorrectReferrer
> 
> Original issue's description:
> > Never send a referrer header if the referrer is not a web url
> > 
> > BUG=none
> > R=abarth@chromium.org
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165085
> 
> TBR=abarth@chromium.org,jochen@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=none
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165090

TBR=abarth@chromium.org,tdanderson@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=none

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165140 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rewrite tests so that they don't depend on apply-author-styles flag.

BUG=323130

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165141 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move Pasteboard, ChromiumDataObject, and ChromiumDataObjectItem to core/dom/

BUG=297477

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165142 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Respsect "Last-Modified" for filesystem: URL too

Embedder can tell the resource's last-modified time, and
older static contents can be cached longer.
(This could affect existing apps, but hopefully not in a too
intrusive way)

Chromium side patch: https://codereview.chromium.org/137893004/

BUG=158861

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

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