コード例 #1
0
OP_STATUS 
OpScopeHttpLogger::RequestSent(void* ptr, const char* ctx, const char* buf, size_t buf_len)
{
	if (IsEnabled())
	{
		double time = g_op_time_info->GetTimeUTC();

		OpScopeHttpInfo *info = reinterpret_cast<OpScopeHttpInfo *>(requests.First());
		for (; info; info = reinterpret_cast<OpScopeHttpInfo *>(info->Suc()))
		{
			if (info->ptr == ptr)
				break;
		}

		if (!info || !AcceptWindow(info->window))
			return OpStatus::OK;

		info->time_request_sent = time;
		Header msg;
		RETURN_IF_ERROR(UpdateHeader(msg, ptr, info->id, ctx, buf, buf_len, info->window, time));
		return SendOnRequest(msg);
	}
	else
		return OpStatus::OK;
}
コード例 #2
0
OP_STATUS
OpScopeHttpLogger::ResponseReceived(void* ptr, const char* ctx)
{
	if (IsEnabled())
	{
		double time = g_op_time_info->GetTimeUTC();
		OpScopeHttpInfo *info = reinterpret_cast<OpScopeHttpInfo *>(requests.First());
		for (; info; info = reinterpret_cast<OpScopeHttpInfo *>(info->Suc()))
		{
			if (info->ptr == ptr)
				break;
		}
		if (info)
		{
			info->time_response_sent = time;
			OP_STATUS status = OpStatus::OK;
			if (AcceptWindow(info->window))
			{
				Header msg;
				RETURN_IF_ERROR(UpdateHeader(msg, ptr, info->id, ctx, info->response_header.CStr(), info->response_header.Length(), info->window, info->time_response_sent));
				status = SendOnResponse(msg);
			}
			info->Out();
			OP_DELETE(info);
			return status;
		}
		else
			return OpStatus::ERR;
	}
	else
		return OpStatus::OK;
}
コード例 #3
0
    void DialogClientView::ButtonPressed(Button* sender, const Event& event)
    {
        // We NULL check the delegate here since the buttons can receive WM_COMMAND
        // messages even after they (and the window containing us) are destroyed.
        if(!GetDialogDelegate())
        {
            return;
        }

        if(sender == ok_button_)
        {
            AcceptWindow();
        }
        else if(sender == cancel_button_)
        {
            CancelWindow();
        }
        else
        {
            NOTREACHED();
        }
    }