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

Side by Side Diff: tools/OmahaCompatibility/console_writer.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_CONSOLE_WRITER_H_
17 #define OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_CONSOLE_WRITER_H_
18
19 #include <Windows.h>
20 #include <tchar.h>
21 #include "omaha/common/synchronized.h"
22 #include "omaha/common/debug.h"
23 #include "omaha/common/logging.h"
24 #include "omaha/worker/ping_event.h"
25 #include "omaha/tools/omahacompatibility/common/ping_observer.h"
26
27 namespace omaha {
28
29 // Observer that writes to the console. It also remembers
30 // the result for install and update completed event.
31 class ConsoleWriter : public PingObserver {
32 public:
33 explicit ConsoleWriter(const CString& app_guid)
34 : app_guid_(app_guid),
35 install_completed_(false),
36 install_result_(PingEvent::EVENT_RESULT_ERROR),
37 update_completed_(false),
38 update_result_(PingEvent::EVENT_RESULT_ERROR) {}
39 virtual ~ConsoleWriter() {}
40 virtual void Observe(const AppRequestData& data);
41
42 // Indicates if a install complete event has been received.
43 bool install_completed() const {
44 return install_completed_;
45 }
46 PingEvent::Results install_result() const {
47 return install_result_;
48 }
49
50 // Indicates if a update complete event has been received.
51 bool update_completed() const {
52 return update_completed_;
53 }
54 PingEvent::Results update_result() const {
55 return update_result_;
56 }
57
58 private:
59 bool IsInstallCompletedEvent(const CString& app_guid,
60 const PingEvent& ping);
61 bool IsUpdateCompletedEvent(const CString& app_guid,
62 const PingEvent& ping);
63 CString PingResultToString(PingEvent::Results result);
64 CString PingTypeToString(PingEvent::Types type);
65
66 CString app_guid_;
67 LLock lock_;
68 PingEvent::Results install_result_;
69 bool install_completed_;
70 PingEvent::Results update_result_;
71 bool update_completed_;
72 };
73
74 } // namespace omaha
75
76 #endif // OMAHA_TOOLS_SRC_OMAHACOMPATIBILITY_CONSOLE_WRITER_H_
OLDNEW
« no previous file with comments | « tools/OmahaCompatibility/compatibility_test.cc ('k') | tools/OmahaCompatibility/console_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698