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

Side by Side Diff: tools/OmahaCompatibility/HttpServer/http_server.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2008-2009 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 // ========================================================================
15
16 #ifndef OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_HTTPSERVER_HTTP_SERVER_H_
17 #define OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_HTTPSERVER_HTTP_SERVER_H_
18
19 #include <windows.h>
20 #include <map>
21 #include "omaha/common/scoped_any.h"
22 #include "omaha/tools/omahacompatibility/httpserver/url_handler.h"
23 #include "omaha/tools/omahacompatibility/httpserver/request.h"
24
25 namespace omaha {
26
27 // The base http server, it takes in a bunch of handlers for
28 // the appropriate paths and invokes them based on the requests
29 // that are sent to the server. This is NOT a general purpose
30 // server, and handles only the requests necessary to enable
31 // omaha client to function correctly.
32 class HttpServer {
33 public:
34 HttpServer(const CString& host, int port);
35 ~HttpServer();
36 HRESULT Initialize();
37 HRESULT AddUrlHandler(UrlHandler* handler);
38 HRESULT Start();
39
40 private:
41 HRESULT Terminate();
42 UrlHandler* GetHandler(const HttpRequest& url);
43 HRESULT ReadRequest(HttpRequest* request);
44 HRESULT SendResponse(const HttpResponse& response);
45 HRESULT SetHeader(HTTP_RESPONSE* http_response,
46 HTTP_HEADER_ID header_id,
47 const char* value);
48
49 scoped_handle request_handle_;
50 std::map<CString, UrlHandler*> handlers_;
51 CString host_;
52 CString url_prefix_;
53 int port_;
54 };
55
56 } // namespace omaha
57
58 #endif // OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_HTTPSERVER_HTTP_SERVER_H_
OLDNEW
« no previous file with comments | « tools/OmahaCompatibility/HttpServer/download_handler.cc ('k') | tools/OmahaCompatibility/HttpServer/http_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698