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. 4 5 #ifndef CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ 6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ 7 8 #include "base/memory/ref_counted.h" 9 #include "content/common/content_export.h" 10 #include "third_party/WebKit/public/platform/WebURLLoader.h" 11 12 namespace content { 13 14 struct ResourceResponseInfo; 15 16 class WebURLLoaderImpl : public blink::WebURLLoader { 17 public: 18 WebURLLoaderImpl(); 19 virtual ~WebURLLoaderImpl(); 20 21 static blink::WebURLError CreateError(const blink::WebURL& unreachable_url, 22 bool stale_copy_in_cache, 23 int reason); 24 CONTENT_EXPORT static void PopulateURLResponse( 25 const GURL& url, 26 const ResourceResponseInfo& info, 27 blink::WebURLResponse* response); 28 29 // WebURLLoader methods: 30 virtual void loadSynchronously( 31 const blink::WebURLRequest& request, 32 blink::WebURLResponse& response, 33 blink::WebURLError& error, 34 blink::WebData& data); 35 virtual void loadAsynchronously( 36 const blink::WebURLRequest& request, 37 blink::WebURLLoaderClient* client); 38 virtual void cancel(); 39 virtual void setDefersLoading(bool value); 40 virtual void didChangePriority(blink::WebURLRequest::Priority new_priority, 41 int intra_priority_value); 42 virtual bool attachThreadedDataReceiver( 43 blink::WebThreadedDataReceiver* threaded_data_receiver); 44 45 private: 46 class Context; 47 scoped_refptr<Context> context_; 48 }; 49 50 } // namespace content 51 52 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ 53