WebPageProxy::close() is a no-op for terminated processes
https://bugs.webkit.org/show_bug.cgi?id=136378
Related to <rdar://problem/16991213> and to <rdar://problem/17095600>

Reviewed by Brady Eidson.

Also fixes issues that got uncovered after making close() work.

* UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): Don't
close the page, because it makes no sense, and causes an assertion now. Previosly,
this was OK because the page was invalid already, and close() was a no-op.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::~WebPageProxy): Added some assertions to catch invalidation
issues earlier.
(WebKit::WebPageProxy::reattachToWebProcess): Make it an invariant that a page's
process always has a message receiver for it, until close() removes it.
(WebKit::WebPageProxy::close): Make this function work for all open pages, whether
they have a page or not.
(WebKit::WebPageProxy::processDidFinishLaunching): Added an asserion that process
agrees about its state.
(WebKit::WebPageProxy::resetStateAfterProcessExited): Don't remove a message receiver,
we now only do this in reattach or close.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More occasional crashes in ServicesController::resfreshExistingServices
https://bugs.webkit.org/show_bug.cgi?id=136387
<rdar://problem/18167200>

Reviewed by Dan Bernstein.

* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::ServicesController):
Speculative fix; if this block is called synchronously, we'll end up
calling back into ::shared() before the NeverDestroyed is initialized,
ending up with two ServicesControllers.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore: Use ASCIILiteral where possible
https://bugs.webkit.org/show_bug.cgi?id=136179

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-08-29
Reviewed by Michael Saboff.

Source/JavaScriptCore:

General string / character related changes. Use ASCIILiteral where
possible, jsNontrivialString where possible, and replace string
literals with character literals in some places.

No new tests, no changes to functionality.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister):
* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitBytecode):
(JSC::PrefixNode::emitBytecode):
(JSC::AssignErrorNode::emitBytecode):
(JSC::ForInNode::emitMultiLoopBytecode):
(JSC::ForOfNode::emitBytecode):
(JSC::ObjectPatternNode::toString):
* dfg/DFGFunctionWhitelist.cpp:
(JSC::DFG::FunctionWhitelist::contains):
* dfg/DFGOperations.cpp:
(JSC::DFG::newTypedArrayWithSize):
(JSC::DFG::newTypedArrayWithOneArgument):
* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::addToFrontend):
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::InspectorBackendDispatcher::dispatch):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
* inspector/scripts/codegen/generator_templates.py:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::functionName):
(JSC::StackVisitor::Frame::sourceURL):
* jit/JITOperations.cpp:
* jsc.cpp:
(functionDescribeArray):
(functionRun):
(functionLoad):
(functionReadFile):
(functionCheckSyntax):
(functionTransferArrayBuffer):
(runWithScripts):
(runInteractive):
* parser/Lexer.cpp:
(JSC::Lexer<T>::invalidCharacterMessage):
(JSC::Lexer<T>::parseString):
(JSC::Lexer<T>::parseStringSlowCase):
(JSC::Lexer<T>::lex):
* profiler/Profile.cpp:
(JSC::Profile::Profile):
* runtime/Arguments.cpp:
(JSC::argumentsFuncIterator):
* runtime/ArrayPrototype.cpp:
(JSC::performSlowSort):
(JSC::arrayProtoFuncSort):
* runtime/ExceptionHelpers.cpp:
(JSC::createError):
(JSC::createInvalidParameterError):
(JSC::createNotAConstructorError):
(JSC::createNotAFunctionError):
(JSC::createNotAnObjectError):
(JSC::createErrorForInvalidGlobalAssignment):
* runtime/FunctionPrototype.cpp:
(JSC::insertSemicolonIfNeeded):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::pop):
(JSC::JSArray::push):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSDataView.cpp:
(JSC::JSDataView::create):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoSetter):
* runtime/JSPromiseConstructor.cpp:
(JSC::JSPromiseConstructor::finishCreation):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lex):
(JSC::LiteralParser<CharType>::Lexer::lexString):
(JSC::LiteralParser<CharType>::parse):
* runtime/LiteralParser.h:
(JSC::LiteralParser::getErrorMessage):
* runtime/TypeSet.cpp:
(JSC::TypeSet::seenTypes):
(JSC::TypeSet::displayName):
(JSC::TypeSet::allPrimitiveTypeNames):
(JSC::StructureShape::propertyHash):
(JSC::StructureShape::stringRepresentation):

Source/WTF:

* wtf/text/WTFString.cpp:
(asciiDebug):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More occasional crashes in ServicesController::resfreshExistingServices
https://bugs.webkit.org/show_bug.cgi?id=136387
<rdar://problem/18167200>

Patch by Tim Horton <timothy_horton@apple.com> on 2014-08-29
Reviewed by Dan Bernstein.

* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::ServicesController):
Speculative fix; if this block is called synchronously, we'll end up
calling back into ::shared() before the NeverDestroyed is initialized,
ending up with two ServicesControllers.



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