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.
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#ifndef CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_
|
|
|
|
#pragma once
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-12-23 18:36:30 +01:00
|
|
|
#include "include/cef_web_urlrequest.h"
|
2011-04-05 18:17:33 +02:00
|
|
|
#include "base/memory/ref_counted.h"
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
class CefWebURLRequestImpl : public CefWebURLRequest {
|
|
|
|
public:
|
2011-02-09 23:04:35 +01:00
|
|
|
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; }
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
protected:
|
2011-02-09 23:04:35 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#endif // CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_
|