2011-02-09 23:04:35 +01:00
|
|
|
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef _WEB_URL_REQUEST_CLIENT_IMPL_H
|
|
|
|
#define _WEB_URL_REQUEST_CLIENT_IMPL_H
|
|
|
|
|
|
|
|
#include "include/cef.h"
|
2011-04-05 18:17:33 +02:00
|
|
|
#include "base/memory/ref_counted.h"
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefWebURLRequestImpl : public CefWebURLRequest
|
2011-02-09 23:04:35 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
explicit CefWebURLRequestImpl(
|
|
|
|
CefRefPtr<CefWebURLRequestClient> handler);
|
|
|
|
virtual ~CefWebURLRequestImpl();
|
|
|
|
|
|
|
|
// Can be called on any thread.
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual RequestState GetState() OVERRIDE;
|
|
|
|
virtual void Cancel() OVERRIDE;
|
2011-02-09 23:04:35 +01:00
|
|
|
|
|
|
|
// Can only be called on the UI thread.
|
|
|
|
void DoSend(CefRefPtr<CefRequest> request);
|
|
|
|
void DoCancel();
|
|
|
|
void DoStateChange(RequestState newState);
|
|
|
|
|
|
|
|
CefRefPtr<CefWebURLRequestClient> GetHandler() { return handler_; }
|
|
|
|
|
|
|
|
static bool ImplementsThreadSafeReferenceCounting() { return true; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CefRefPtr<CefWebURLRequestClient> handler_;
|
|
|
|
|
|
|
|
// The below parameters are only modified on the UI thread.
|
|
|
|
RequestState state_;
|
|
|
|
scoped_refptr<Context> context_;
|
2011-05-20 16:42:25 +02:00
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefWebURLRequestImpl);
|
|
|
|
IMPLEMENT_LOCKING(CefWebURLRequestImpl);
|
2011-02-09 23:04:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WEB_URL_REQUEST_CLIENT_IMPL_H
|