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

Side by Side Diff: tools/OmahaCompatibility/HttpServer/download_handler.cc

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
17 #include "omaha/tools/omahacompatibility/httpserver/download_handler.h"
18 #include "omaha/common/debug.h"
19 #include "omaha/common/logging.h"
20 #include "omaha/common/path.h"
21
22 namespace omaha {
23
24 HRESULT DownloadHandler::HandleRequest(const HttpRequest& request,
25 HttpResponse* response) {
26 CORE_LOG(L1, (_T("[DownloadHandler::HandleRequest]")));
27 ASSERT1(response);
28
29 for (size_t i = 0; i < responses_.size(); ++i) {
30 CString requested_file = GetFileFromPath(request.path());
31 if (GetFileFromPath(responses_[i].local_file_name) == requested_file) {
32 // We know about the file that was asked for.
33 response->set_size(responses_[i].size);
34 response->set_file_name(responses_[i].local_file_name);
35 return S_OK;
36 }
37 }
38
39 return S_OK;
40 }
41
42 HRESULT DownloadHandler::AddDownloadFile(const ConfigResponse& response) {
43 CORE_LOG(L1, (_T("[DownloadHandler::AddDownloadFile]")));
44 responses_.push_back(response);
45 return S_OK;
46 }
47
48 } // namespace omaha
OLDNEW
« no previous file with comments | « tools/OmahaCompatibility/HttpServer/download_handler.h ('k') | tools/OmahaCompatibility/HttpServer/http_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698