1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that can 3 // be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_ 6 #define CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_ 7 8 #include "include/cef_frame.h" 9 #include "include/cef_urlrequest.h" 10 11 #include "base/memory/ref_counted.h" 12 13 class CefRenderURLRequest : public CefURLRequest { 14 public: 15 class Context; 16 17 // If |frame| is nullptr the default URLLoaderFactory will be used. That 18 // factory only supports http(s) and blob requests that cannot be 19 // intercepted in the browser process. 20 CefRenderURLRequest(CefRefPtr<CefFrame> frame, 21 CefRefPtr<CefRequest> request, 22 CefRefPtr<CefURLRequestClient> client); 23 ~CefRenderURLRequest() override; 24 25 bool Start(); 26 27 // CefURLRequest methods. 28 CefRefPtr<CefRequest> GetRequest() override; 29 CefRefPtr<CefURLRequestClient> GetClient() override; 30 Status GetRequestStatus() override; 31 ErrorCode GetRequestError() override; 32 CefRefPtr<CefResponse> GetResponse() override; 33 bool ResponseWasCached() override; 34 void Cancel() override; 35 36 private: 37 bool VerifyContext(); 38 39 scoped_refptr<Context> context_; 40 41 IMPLEMENT_REFCOUNTING(CefRenderURLRequest); 42 }; 43 44 #endif // CEF_LIBCEF_RENDERER_RENDER_URLREQUEST_IMPL_H_ 45