ASSERT(m_readStream);
ASSERT(m_writeStream);
- CFStreamClientContext clientContext = { 0, this, 0, 0, copyCFStreamDescription };
+ CFStreamClientContext clientContext = { 0, this, retainSocketStreamHandle, releaseSocketStreamHandle, copyCFStreamDescription };
// FIXME: Pass specific events we're interested in instead of -1.
CFReadStreamSetClient(m_readStream.get(), static_cast<CFOptionFlags>(-1), readStreamCallback, &clientContext);
CFWriteStreamSetClient(m_writeStream.get(), static_cast<CFOptionFlags>(-1), writeStreamCallback, &clientContext);
m_connectingSubstate = WaitingForConnect;
}
+void* SocketStreamHandle::retainSocketStreamHandle(void* info)
+{
+ SocketStreamHandle* handle = static_cast<SocketStreamHandle*>(info);
+ handle->ref();
+ return handle;
+}
+
+void SocketStreamHandle::releaseSocketStreamHandle(void* info)
+{
+ SocketStreamHandle* handle = static_cast<SocketStreamHandle*>(info);
+ handle->deref();
+}
+
CFStringRef SocketStreamHandle::copyPACExecutionDescription(void*)
{
return CFSTR("WebSocket proxy PAC file execution");
MainThreadPACCallbackInfo* info = static_cast<MainThreadPACCallbackInfo*>(invocation);
ASSERT(info->handle->m_connectingSubstate == ExecutingPACFile);
// This time, the array won't have PAC as a first entry.
+ if (info->handle->m_state != Connecting)
+ return;
info->handle->chooseProxyFromArray(info->proxyList);
info->handle->createStreams();
info->handle->scheduleStreams();
void SocketStreamHandle::executePACFileURL(CFURLRef pacFileURL)
{
// CFNetwork returns an empty proxy array for WebScoket schemes, so use m_httpsURL.
- CFStreamClientContext clientContext = { 0, this, 0, 0, copyPACExecutionDescription };
+ CFStreamClientContext clientContext = { 0, this, retainSocketStreamHandle, releaseSocketStreamHandle, copyPACExecutionDescription };
m_pacRunLoopSource.adoptCF(CFNetworkExecuteProxyAutoConfigurationURL(pacFileURL, m_httpsURL.get(), pacExecutionCallback, &clientContext));
#if PLATFORM(WIN)
CFRunLoopAddSource(loaderRunLoop(), m_pacRunLoopSource.get(), kCFRunLoopDefaultMode);
if (m_connectingSubstate == WaitingForConnect) {
m_connectingSubstate = Connected;
m_state = Open;
-
- RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
m_client->didOpenSocketStream(this);
if (m_state == Closed)
break;
if (m_connectingSubstate == WaitingForConnect) {
m_connectingSubstate = Connected;
m_state = Open;
-
- RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
m_client->didOpenSocketStream(this);
break;
}
String description;
#if PLATFORM(MAC)
+
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
if (CFEqual(CFErrorGetDomain(error), kCFErrorDomainOSStatus)) {
const char* descriptionOSStatus = GetMacOSStatusCommentString(static_cast<OSStatus>(errorCode));
if (descriptionOSStatus && descriptionOSStatus[0] != '\0')
description = "OSStatus Error " + String::number(errorCode) + ": " + descriptionOSStatus;
}
+
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
#endif
if (description.isNull()) {