1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WEBKIT_CHILD_WEBURLLOADER_IMPL_H_
6 #define WEBKIT_CHILD_WEBURLLOADER_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "third_party/WebKit/public/platform/WebURLLoader.h"
10 #include "webkit/child/webkit_child_export.h"
12 namespace webkit_glue {
14 class WebKitPlatformSupportImpl;
15 struct ResourceResponseInfo;
17 class WebURLLoaderImpl : public blink::WebURLLoader {
19 explicit WebURLLoaderImpl(WebKitPlatformSupportImpl* platform);
20 virtual ~WebURLLoaderImpl();
22 static blink::WebURLError CreateError(const blink::WebURL& unreachable_url,
23 bool stale_copy_in_cache,
25 WEBKIT_CHILD_EXPORT static void PopulateURLResponse(
27 const ResourceResponseInfo& info,
28 blink::WebURLResponse* response);
30 // WebURLLoader methods:
31 virtual void loadSynchronously(
32 const blink::WebURLRequest& request,
33 blink::WebURLResponse& response,
34 blink::WebURLError& error,
35 blink::WebData& data);
36 virtual void loadAsynchronously(
37 const blink::WebURLRequest& request,
38 blink::WebURLLoaderClient* client);
39 virtual void cancel();
40 virtual void setDefersLoading(bool value);
41 virtual void didChangePriority(blink::WebURLRequest::Priority new_priority);
45 scoped_refptr<Context> context_;
46 WebKitPlatformSupportImpl* platform_;
49 } // namespace webkit_glue
51 #endif // WEBKIT_CHILD_WEBURLLOADER_IMPL_H_