Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: net/test/embedded_test_server/embedded_test_server.h

Issue 1093993003: Allow embedded_test_server to serve from multiple directories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix iOS Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/net.gyp ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_
6 #define NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ 6 #define NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 // Returns the port number used by the server. 138 // Returns the port number used by the server.
139 uint16 port() const { return port_; } 139 uint16 port() const { return port_; }
140 140
141 // Registers request handler which serves files from |directory|. 141 // Registers request handler which serves files from |directory|.
142 // For instance, a request to "/foo.html" is served by "foo.html" under 142 // For instance, a request to "/foo.html" is served by "foo.html" under
143 // |directory|. Files under sub directories are also handled in the same way 143 // |directory|. Files under sub directories are also handled in the same way
144 // (i.e. "/foo/bar.html" is served by "foo/bar.html" under |directory|). 144 // (i.e. "/foo/bar.html" is served by "foo/bar.html" under |directory|).
145 void ServeFilesFromDirectory(const base::FilePath& directory); 145 void ServeFilesFromDirectory(const base::FilePath& directory);
146 146
147 // Similar to the above method, but takes multiple directories. The first
148 // matched file would be served.
149 void ServeFilesFromDirectories(
150 const std::vector<base::FilePath>& directories);
151
147 // The most general purpose method. Any request processing can be added using 152 // The most general purpose method. Any request processing can be added using
148 // this method. Takes ownership of the object. The |callback| is called 153 // this method. Takes ownership of the object. The |callback| is called
149 // on UI thread. 154 // on UI thread.
150 void RegisterRequestHandler(const HandleRequestCallback& callback); 155 void RegisterRequestHandler(const HandleRequestCallback& callback);
151 156
152 // Stops IO thread that handles http requests. 157 // Stops IO thread that handles http requests.
153 void StopThread(); 158 void StopThread();
154 159
155 // Restarts IO thread and listen on the socket. 160 // Restarts IO thread and listen on the socket.
156 void RestartThreadAndListen(); 161 void RestartThreadAndListen();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // invalidate its weak pointers before any other members are destroyed. 208 // invalidate its weak pointers before any other members are destroyed.
204 base::WeakPtrFactory<EmbeddedTestServer> weak_factory_; 209 base::WeakPtrFactory<EmbeddedTestServer> weak_factory_;
205 210
206 DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServer); 211 DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServer);
207 }; 212 };
208 213
209 } // namespace test_servers 214 } // namespace test_servers
210 } // namespace net 215 } // namespace net
211 216
212 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ 217 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_
OLDNEW
« no previous file with comments | « net/net.gyp ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698