Crash when multiple WebView instances have different PrivateBrowsing settings
https://bugs.webkit.org/show_bug.cgi?id=127019

Reviewed by Sam Weinig.

* WebView/WebView.mm: (-[WebView _preferencesChanged:]): Don't delete a private
browsing session simply because one preferences object doesn't use private browsing.
There could be others that do.

* WebView/WebPreferences.mm: Track how many WebPreferences objects use private
browsing, and only delete the private session when there are none any more.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r161980.

CachedResourcesLoader.h should not belong to the CSS_SHADERS flag since it is used
out of the flag so it causes a compile failure when svg and css shaders are concurrently disabled.

* css/StyleResolver.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] UI process crashes when the web process crashes while printing
https://bugs.webkit.org/show_bug.cgi?id=126977

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

When the web process crashes, the printing callback is
invalidated, so the function is called with a NULL error.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted): Check wkError is not NULL before
trying to use it.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPrintFrame): Set the print mode of the operation
before emitting the print signal.

Tools:

Add new test case to check that closing the window right after
printing works. It's skipped for now, because this patch only
fixes the UI process crash, but not the web process one.

* Scripts/run-gtk-tests:
(TestRunner): Skip
/webkit2/WebKitPrintOperation/close-after-print.
* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
(testPrintOperationPrintPrinter):
(findPrintToFilePrinter):
(testPrintOperationPrint):
(testPrintOperationErrors):
(testPrintOperationCloseAfterPrint):
(beforeAll):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] UI process crashes when closing the window right after printing with javascript
https://bugs.webkit.org/show_bug.cgi?id=126981

Reviewed by Gustavo Noronha Silva.

The UI process crashes because when the page is closed, the web
view is destroyed before the print operation has actually
finished. Use a weak pointer to make sure the web view pointer is
set to NULL when the it's destroyed and emit the finished callback
always so that the user can clean up the operation even when the
web view has been closed.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make DoYouEvenBench runnable by run-perf-tests
https://bugs.webkit.org/show_bug.cgi?id=127030

Reviewed by Andreas Kling.

PerformanceTests:

Added Full.html that runs 5 iterations of DoYouEvenBench. This is the canonical DoYouEvenBench,
which is also runnable by run-perf-tests.

* DoYouEvenBench/Full.html: Added.

* DoYouEvenBench/benchmark.html:
(startTest): Updated the code to account for the fact old measuredValues is pushed down to tests
property and we now have total property so that we don't have to manually compute the total.

* DoYouEvenBench/resources/benchmark-report.js: Added. When we're inside a DRT/WTR, use
PerfTestRunner to output that can be parsed by run-perf-tests. Do the same when the query part
or the fragment part of the current URL is "webkit" for debugging purposes.

* DoYouEvenBench/resources/benchmark-runner.js:
(BenchmarkRunner):
(BenchmarkRunner.prototype._appendFrame): Position the frame at (0, 0) inside DRT and WTR since
we have exactly 800px by 600px inside those two test runners. Also always insert the iframe as
the first child of body to avoid inserting it after the pre inserted by the test runner.
(BenchmarkRunner.prototype.step): Initializes _measuredValues.
(BenchmarkRunner.prototype.runAllSteps): Merged callNextStep in benchmark.html.
(BenchmarkRunner.prototype.runMultipleIterations): Added.
(BenchmarkRunner.prototype._runTestAndRecordResults): Compute the grand total among suites.
Also push down the sync and async time into tests property for consistency.
(BenchmarkRunner.prototype._finalize):

* Dromaeo/resources/dromaeorunner.js:
(DRT.testObject): Renamed dromaeoIterationCount to customIterationCount as this option is also
used by DoYouEvenBench.

* resources/runner.js: Ditto.
(.finish): Spit out the aggregator name.

Tools:

Ignore console messages spit out by DoYouEvenBench and support aggregator names such as
":Total" to appear at the end of a test name. We don't do anything with it for now.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest._metrics_regex): Handle aggregator names such as ":Total". We'll pass it down
to the JSON in a follow up patch for the perf dashboard.
(PerfTest._lines_to_ignore_in_parser_result): Added lines to ignore for DoYouEvenBench.

LayoutTests:

Use customIterationCount as it has been renamed from dromaeoIterationCount.

* fast/harness/perftests/runs-per-second-iterations.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162058 268f45cc-cd09-0410-ab3c-d52691b4dbfc