OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ |
6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ | 6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "net/http/http_cache.h" | 10 #include "net/http/http_cache.h" |
11 #include "webkit/glue/resource_loader_bridge.h" | 11 #include "webkit/glue/resource_loader_bridge.h" |
12 | 12 |
| 13 class GURL; |
| 14 |
| 15 namespace base { |
13 class FilePath; | 16 class FilePath; |
14 class GURL; | 17 } |
15 | 18 |
16 class SimpleResourceLoaderBridge { | 19 class SimpleResourceLoaderBridge { |
17 public: | 20 public: |
18 // Call this function to initialize the simple resource loader bridge. | 21 // Call this function to initialize the simple resource loader bridge. |
19 // It is safe to call this function multiple times. | 22 // It is safe to call this function multiple times. |
20 // | 23 // |
21 // NOTE: If this function is not called, then a default request context will | 24 // NOTE: If this function is not called, then a default request context will |
22 // be initialized lazily. | 25 // be initialized lazily. |
23 // | 26 // |
24 static void Init(const FilePath& cache_path, | 27 static void Init(const base::FilePath& cache_path, |
25 net::HttpCache::Mode cache_mode, | 28 net::HttpCache::Mode cache_mode, |
26 bool no_proxy); | 29 bool no_proxy); |
27 | 30 |
28 // Call this function to shutdown the simple resource loader bridge. | 31 // Call this function to shutdown the simple resource loader bridge. |
29 static void Shutdown(); | 32 static void Shutdown(); |
30 | 33 |
31 // May only be called after Init. | 34 // May only be called after Init. |
32 static void SetCookie(const GURL& url, | 35 static void SetCookie(const GURL& url, |
33 const GURL& first_party_for_cookies, | 36 const GURL& first_party_for_cookies, |
34 const std::string& cookie); | 37 const std::string& cookie); |
(...skipping 14 matching lines...) Expand all Loading... |
49 // the path that follows after the |file_path_template| in the request. | 52 // the path that follows after the |file_path_template| in the request. |
50 static void AllowFileOverHTTP(const std::string& file_path_template, | 53 static void AllowFileOverHTTP(const std::string& file_path_template, |
51 const GURL& http_prefix); | 54 const GURL& http_prefix); |
52 | 55 |
53 // Creates a ResourceLoaderBridge instance. | 56 // Creates a ResourceLoaderBridge instance. |
54 static webkit_glue::ResourceLoaderBridge* Create( | 57 static webkit_glue::ResourceLoaderBridge* Create( |
55 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); | 58 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); |
56 }; | 59 }; |
57 | 60 |
58 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ | 61 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ |
OLD | NEW |