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

Side by Side Diff: common/update_response.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
« no previous file with comments | « common/update_request_unittest.cc ('k') | common/update_response.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2009-2010 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 // UpdateRequest allows the caller to deserialize an update request into
17 // a corresponding object object.
18
19 #ifndef OMAHA_COMMON_UPDATE_RESPONSE_H_
20 #define OMAHA_COMMON_UPDATE_RESPONSE_H_
21
22 #include <windows.h>
23 #include <utility>
24 #include <vector>
25 #include "base/basictypes.h"
26 #include "omaha/common/protocol_definition.h"
27
28 namespace omaha {
29
30 namespace xml {
31
32 class UpdateResponse {
33 public:
34 ~UpdateResponse();
35
36 // Creates an instance of the class. Caller takes ownership.
37 static UpdateResponse* Create();
38
39 // Initializes an update response from a xml document in a buffer.
40 HRESULT Deserialize(const std::vector<uint8>& buffer);
41
42 // Initializes an update response from a xml document in a file.
43 HRESULT DeserializeFromFile(const CString& filename);
44
45 int GetElapsedSecondsSinceDayStart() const;
46
47 const response::Response& response() const { return response_; }
48
49 private:
50 friend class XmlParser;
51 friend class XmlParserTest;
52
53 // Sets response_ for unit testing.
54 friend void SetResponseForUnitTest(UpdateResponse* update_response,
55 const response::Response& response);
56
57 UpdateResponse();
58
59 response::Response response_;
60
61 DISALLOW_COPY_AND_ASSIGN(UpdateResponse);
62 };
63
64 typedef std::pair<HRESULT, CString> UpdateResponseResult;
65
66 } // namespace xml
67
68 } // namespace omaha
69
70 #endif // OMAHA_COMMON_UPDATE_RESPONSE_H_
71
OLDNEW
« no previous file with comments | « common/update_request_unittest.cc ('k') | common/update_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698