OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
11 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 13 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
12 | 14 |
| 15 class GURL; |
| 16 |
13 namespace content { | 17 namespace content { |
14 | 18 |
15 class ResourceDispatcher; | 19 class ResourceDispatcher; |
16 struct ResourceResponseInfo; | 20 struct ResourceResponseInfo; |
17 | 21 |
| 22 // Extracts info from a data scheme URL into |info| and |data|. Returns net::OK |
| 23 // if successful. Returns a net error code otherwise. Exported only for testing. |
| 24 CONTENT_EXPORT int GetInfoFromDataURL(const GURL& url, |
| 25 ResourceResponseInfo* info, |
| 26 std::string* data); |
| 27 |
18 class CONTENT_EXPORT WebURLLoaderImpl | 28 class CONTENT_EXPORT WebURLLoaderImpl |
19 : public NON_EXPORTED_BASE(blink::WebURLLoader) { | 29 : public NON_EXPORTED_BASE(blink::WebURLLoader) { |
20 public: | 30 public: |
21 explicit WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher); | 31 explicit WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher); |
22 virtual ~WebURLLoaderImpl(); | 32 virtual ~WebURLLoaderImpl(); |
23 | 33 |
24 static blink::WebURLError CreateError(const blink::WebURL& unreachable_url, | 34 static blink::WebURLError CreateError(const blink::WebURL& unreachable_url, |
25 bool stale_copy_in_cache, | 35 bool stale_copy_in_cache, |
26 int reason); | 36 int reason); |
27 static void PopulateURLResponse( | 37 static void PopulateURLResponse( |
(...skipping 20 matching lines...) Expand all Loading... |
48 private: | 58 private: |
49 class Context; | 59 class Context; |
50 scoped_refptr<Context> context_; | 60 scoped_refptr<Context> context_; |
51 | 61 |
52 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); | 62 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); |
53 }; | 63 }; |
54 | 64 |
55 } // namespace content | 65 } // namespace content |
56 | 66 |
57 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 67 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
OLD | NEW |