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

Side by Side Diff: chrome_frame/test/test_server.h

Issue 12321062: base: Move MemoryMappedFile out of file_util.h and into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chrome_frame again Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/navigation_test.cc ('k') | chrome_frame/test/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 CHROME_FRAME_TEST_TEST_SERVER_H_ 5 #ifndef CHROME_FRAME_TEST_TEST_SERVER_H_
6 #define CHROME_FRAME_TEST_TEST_SERVER_H_ 6 #define CHROME_FRAME_TEST_TEST_SERVER_H_
7 7
8 // Implementation of an HTTP server for tests. 8 // Implementation of an HTTP server for tests.
9 // To instantiate the server, make sure you have a message loop on the 9 // To instantiate the server, make sure you have a message loop on the
10 // current thread and then create an instance of the SimpleWebServer class. 10 // current thread and then create an instance of the SimpleWebServer class.
(...skipping 21 matching lines...) Expand all
32 // To implement a custom response object (e.g. to match against a request 32 // To implement a custom response object (e.g. to match against a request
33 // based on some data, serve up dynamic content or take some action on the 33 // based on some data, serve up dynamic content or take some action on the
34 // server), just inherit from one of the response classes or directly from the 34 // server), just inherit from one of the response classes or directly from the
35 // Response interface and add your response object to the server's list of 35 // Response interface and add your response object to the server's list of
36 // response objects. 36 // response objects.
37 37
38 #include <list> 38 #include <list>
39 #include <string> 39 #include <string>
40 40
41 #include "base/basictypes.h" 41 #include "base/basictypes.h"
42 #include "base/file_util.h" 42 #include "base/file_path.h"
43 #include "base/files/memory_mapped_file.h"
43 #include "base/message_loop.h" 44 #include "base/message_loop.h"
44 #include "net/base/stream_listen_socket.h" 45 #include "net/base/stream_listen_socket.h"
45 46
46 namespace test_server { 47 namespace test_server {
47 48
48 class Request { 49 class Request {
49 public: 50 public:
50 Request() : content_length_(0) { 51 Request() : content_length_(0) {
51 } 52 }
52 53
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 FileResponse(const char* request_path, const base::FilePath& file_path) 245 FileResponse(const char* request_path, const base::FilePath& file_path)
245 : ResponseForPath(request_path), file_path_(file_path) { 246 : ResponseForPath(request_path), file_path_(file_path) {
246 } 247 }
247 248
248 virtual bool GetContentType(std::string* content_type) const; 249 virtual bool GetContentType(std::string* content_type) const;
249 virtual void WriteContents(net::StreamListenSocket* socket) const; 250 virtual void WriteContents(net::StreamListenSocket* socket) const;
250 virtual size_t ContentLength() const; 251 virtual size_t ContentLength() const;
251 252
252 protected: 253 protected:
253 base::FilePath file_path_; 254 base::FilePath file_path_;
254 mutable scoped_ptr<file_util::MemoryMappedFile> file_; 255 mutable scoped_ptr<base::MemoryMappedFile> file_;
255 256
256 private: 257 private:
257 DISALLOW_COPY_AND_ASSIGN(FileResponse); 258 DISALLOW_COPY_AND_ASSIGN(FileResponse);
258 }; 259 };
259 260
260 // Returns a 302 (temporary redirect) to redirect the client from a path 261 // Returns a 302 (temporary redirect) to redirect the client from a path
261 // on the test server to a different URL. 262 // on the test server to a different URL.
262 class RedirectResponse : public ResponseForPath { 263 class RedirectResponse : public ResponseForPath {
263 public: 264 public:
264 RedirectResponse(const char* request_path, const std::string& redirect_url) 265 RedirectResponse(const char* request_path, const std::string& redirect_url)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 439
439 scoped_refptr<net::StreamListenSocket> server_; 440 scoped_refptr<net::StreamListenSocket> server_;
440 ConnectionList connection_list_; 441 ConnectionList connection_list_;
441 442
442 DISALLOW_COPY_AND_ASSIGN(HTTPTestServer); 443 DISALLOW_COPY_AND_ASSIGN(HTTPTestServer);
443 }; 444 };
444 445
445 } // namespace test_server 446 } // namespace test_server
446 447
447 #endif // CHROME_FRAME_TEST_TEST_SERVER_H_ 448 #endif // CHROME_FRAME_TEST_TEST_SERVER_H_
OLDNEW
« no previous file with comments | « chrome_frame/test/navigation_test.cc ('k') | chrome_frame/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698