Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / child / web_url_loader_impl.h
blob01e1c0f2a6b22b2b6ef84ca9f543f538e6ac123b
1 // Copyright 2014 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 CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_
6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebURLLoader.h"
13 class GURL;
15 namespace content {
17 class ResourceDispatcher;
18 struct ResourceResponseInfo;
20 class CONTENT_EXPORT WebURLLoaderImpl
21 : public NON_EXPORTED_BASE(blink::WebURLLoader) {
22 public:
23 explicit WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher);
24 virtual ~WebURLLoaderImpl();
26 static blink::WebURLError CreateError(const blink::WebURL& unreachable_url,
27 bool stale_copy_in_cache,
28 int reason);
29 static void PopulateURLResponse(
30 const GURL& url,
31 const ResourceResponseInfo& info,
32 blink::WebURLResponse* response);
34 // WebURLLoader methods:
35 virtual void loadSynchronously(
36 const blink::WebURLRequest& request,
37 blink::WebURLResponse& response,
38 blink::WebURLError& error,
39 blink::WebData& data) OVERRIDE;
40 virtual void loadAsynchronously(
41 const blink::WebURLRequest& request,
42 blink::WebURLLoaderClient* client) OVERRIDE;
43 virtual void cancel() OVERRIDE;
44 virtual void setDefersLoading(bool value) OVERRIDE;
45 virtual void didChangePriority(blink::WebURLRequest::Priority new_priority,
46 int intra_priority_value) OVERRIDE;
47 virtual bool attachThreadedDataReceiver(
48 blink::WebThreadedDataReceiver* threaded_data_receiver) OVERRIDE;
50 private:
51 class Context;
52 scoped_refptr<Context> context_;
54 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl);
57 } // namespace content
59 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_