| 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 | 12 |
| 12 class FilePath; | 13 class FilePath; |
| 13 class GURL; | 14 class GURL; |
| 14 | 15 |
| 15 class SimpleResourceLoaderBridge { | 16 class SimpleResourceLoaderBridge { |
| 16 public: | 17 public: |
| 17 // Call this function to initialize the simple resource loader bridge. | 18 // Call this function to initialize the simple resource loader bridge. |
| 18 // It is safe to call this function multiple times. | 19 // It is safe to call this function multiple times. |
| 19 // | 20 // |
| 20 // NOTE: If this function is not called, then a default request context will | 21 // NOTE: If this function is not called, then a default request context will |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Call this function to set up whether using file-over-http feature. | 46 // Call this function to set up whether using file-over-http feature. |
| 46 // |file_over_http| indicates whether using file-over-http or not. | 47 // |file_over_http| indicates whether using file-over-http or not. |
| 47 // If yes, when the request url uses file scheme and matches sub string | 48 // If yes, when the request url uses file scheme and matches sub string |
| 48 // |file_path_template|, SimpleResourceLoaderBridge will use |http_prefix| | 49 // |file_path_template|, SimpleResourceLoaderBridge will use |http_prefix| |
| 49 // plus string of after |file_path_template| in original request URl to | 50 // plus string of after |file_path_template| in original request URl to |
| 50 // generate a new http URL to get the data and send back to peer. | 51 // generate a new http URL to get the data and send back to peer. |
| 51 // That is how we implement file-over-http feature. | 52 // That is how we implement file-over-http feature. |
| 52 static void AllowFileOverHTTP(const std::string& file_path_template, | 53 static void AllowFileOverHTTP(const std::string& file_path_template, |
| 53 const GURL& http_prefix); | 54 const GURL& http_prefix); |
| 55 |
| 56 // Creates a ResourceLoaderBridge instance. |
| 57 static webkit_glue::ResourceLoaderBridge* Create( |
| 58 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); |
| 54 }; | 59 }; |
| 55 | 60 |
| 56 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ | 61 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_RESOURCE_LOADER_BRIDGE_H__ |
| OLD | NEW |