summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-26 16:33:29 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-26 16:33:29 +0000
commit238a20d1987f93f79895a8f8710ac9912e8d60a0 (patch)
treee6650a8c0e4eeeee8f98d6d3b3a6f335e8545d15 /base
parent7c19b87b028f32ccb4664699fc3386f1ba97d083 (diff)
downloadchromium_src-238a20d1987f93f79895a8f8710ac9912e8d60a0.zip
chromium_src-238a20d1987f93f79895a8f8710ac9912e8d60a0.tar.gz
chromium_src-238a20d1987f93f79895a8f8710ac9912e8d60a0.tar.bz2
Unfork test_shell_main:
- remove Mac version - move platform-specific operations into PlatformDelegate and remove #ifdefs - add event recorder link stubs for use by platforms that don't have event recording working yet Notes: There's a bunch of stuff in test_shell_{gtk,mac,win} that should also be pulled into the platform delegate so that the TestShell class can also be unforked, but those can be worked on independently per platform after this refactoring. Review URL: http://codereview.chromium.org/18451 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/base.xcodeproj/project.pbxproj4
-rw-r--r--base/base_lib.scons2
-rw-r--r--base/event_recorder.cc4
-rw-r--r--base/event_recorder.h8
-rw-r--r--base/event_recorder_stubs.cc28
5 files changed, 45 insertions, 1 deletions
diff --git a/base/base.xcodeproj/project.pbxproj b/base/base.xcodeproj/project.pbxproj
index e404033..e5ef83a 100644
--- a/base/base.xcodeproj/project.pbxproj
+++ b/base/base.xcodeproj/project.pbxproj
@@ -155,6 +155,7 @@
A5A0270B0E4A630D00498DA9 /* file_util_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5A0270A0E4A630D00498DA9 /* file_util_mac.mm */; };
A5CE1D2B0E55F4D800AD0606 /* file_util_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = A5A0282D0E4CFA8500498DA9 /* file_util_unittest.cc */; };
AB4C147D0EC0E3F600655FED /* time_mac.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BEB81490D9B0F33009BA8DD /* time_mac.cc */; };
+ AB4FA13A0F2A101100D6572F /* event_recorder_stubs.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB4FA1390F2A101100D6572F /* event_recorder_stubs.cc */; };
ABE1BA2A0E7574D1009041DA /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE1BA290E7574D1009041DA /* ApplicationServices.framework */; };
ABF4B98F0DC2BA6900A6E319 /* base_paths_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF4B98E0DC2BA6900A6E319 /* base_paths_mac.mm */; };
ABF4B99E0DC2BB6000A6E319 /* clipboard_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF4B99D0DC2BB6000A6E319 /* clipboard_mac.mm */; };
@@ -612,6 +613,7 @@
A5A0276B0E4BA33700498DA9 /* build_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_config.h; path = ../build/build_config.h; sourceTree = SOURCE_ROOT; };
A5A0282D0E4CFA8500498DA9 /* file_util_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_util_unittest.cc; sourceTree = "<group>"; };
AB14B6060EBFA74C00FB3807 /* time_posix.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = time_posix.cc; sourceTree = "<group>"; };
+ AB4FA1390F2A101100D6572F /* event_recorder_stubs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event_recorder_stubs.cc; sourceTree = "<group>"; };
ABE1BA290E7574D1009041DA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<group>"; };
ABF4B98E0DC2BA6900A6E319 /* base_paths_mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = base_paths_mac.mm; sourceTree = "<group>"; };
ABF4B99D0DC2BB6000A6E319 /* clipboard_mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clipboard_mac.mm; sourceTree = "<group>"; };
@@ -852,6 +854,7 @@
536092F80ECE474500D1B91E /* dtoa.cc */,
825402FF0D92D1BC0006B936 /* event_recorder.cc */,
825403000D92D1BC0006B936 /* event_recorder.h */,
+ AB4FA1390F2A101100D6572F /* event_recorder_stubs.cc */,
ABF68B270EB0F93100E72835 /* field_trial.h */,
ABF68B280EB0F93100E72835 /* field_trial.cc */,
ABF68B260EB0F93100E72835 /* field_trial_unittest.cc */,
@@ -1359,6 +1362,7 @@
7B78CE250E5314A000609465 /* debug_util.cc in Sources */,
7B78CE120E53131800609465 /* debug_util_posix.cc in Sources */,
536092FA0ECE474500D1B91E /* dtoa.cc in Sources */,
+ AB4FA13A0F2A101100D6572F /* event_recorder_stubs.cc in Sources */,
ABF68B2A0EB0F93100E72835 /* field_trial.cc in Sources */,
4D11B89E0E929F0400EF7617 /* file_path.cc in Sources */,
A5A026550E4A214600498DA9 /* file_util.cc in Sources */,
diff --git a/base/base_lib.scons b/base/base_lib.scons
index 7965c5e..93bf869 100644
--- a/base/base_lib.scons
+++ b/base/base_lib.scons
@@ -353,6 +353,7 @@ if env.Bit('posix'):
if env.Bit('mac'):
input_files.Extend([
'base_paths_mac.mm',
+ 'event_recorder_stubs.cc',
'clipboard_mac.mm',
'file_util_mac.mm',
'file_version_info_mac.mm',
@@ -372,6 +373,7 @@ if env.Bit('linux'):
'base_paths_linux.cc',
'clipboard_linux.cc',
'data_pack.cc',
+ 'event_recorder_stubs.cc',
'file_util_linux.cc',
'file_version_info_linux.cc',
'hmac_nss.cc',
diff --git a/base/event_recorder.cc b/base/event_recorder.cc
index ab7fcf9..0f1fb21 100644
--- a/base/event_recorder.cc
+++ b/base/event_recorder.cc
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/event_recorder.h"
+#include "build/build_config.h"
+#include <windows.h>
#include <mmsystem.h>
+#include "base/event_recorder.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/time.h"
diff --git a/base/event_recorder.h b/base/event_recorder.h
index a258d3a..43278c6 100644
--- a/base/event_recorder.h
+++ b/base/event_recorder.h
@@ -6,7 +6,9 @@
#define BASE_EVENT_RECORDER_H_
#include <string>
+#if defined(OS_WIN)
#include <windows.h>
+#endif
#include "base/basictypes.h"
namespace base {
@@ -55,10 +57,12 @@ class EventRecorder {
// Is the EventRecorder currently playing.
bool is_playing() const { return is_playing_; }
+#if defined(OS_WIN)
// C-style callbacks for the EventRecorder.
// Used for internal purposes only.
LRESULT RecordWndProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT PlaybackWndProc(int nCode, WPARAM wParam, LPARAM lParam);
+#endif
private:
// Create a new EventRecorder. Events are saved to the file filename.
@@ -67,8 +71,10 @@ class EventRecorder {
explicit EventRecorder()
: is_recording_(false),
is_playing_(false),
+#if defined(OS_WIN)
journal_hook_(NULL),
file_(NULL),
+#endif
playback_first_msg_time_(0),
playback_start_time_(0) {
}
@@ -78,9 +84,11 @@ class EventRecorder {
bool is_recording_;
bool is_playing_;
+#if defined(OS_WIN)
HHOOK journal_hook_;
FILE* file_;
EVENTMSG playback_msg_;
+#endif
int playback_first_msg_time_;
int playback_start_time_;
diff --git a/base/event_recorder_stubs.cc b/base/event_recorder_stubs.cc
new file mode 100644
index 0000000..9499c75
--- /dev/null
+++ b/base/event_recorder_stubs.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/event_recorder.h"
+
+// This file implements a link stub for EventRecorder that can be used on
+// platforms that don't have a working EventRecorder implementation.
+
+namespace base {
+
+EventRecorder* EventRecorder::current_; // Our singleton.
+
+bool EventRecorder::StartRecording(const std::wstring& filename) {
+ return true;
+}
+
+void EventRecorder::StopRecording() {
+}
+
+bool EventRecorder::StartPlayback(const std::wstring& filename) {
+ return false;
+}
+
+void EventRecorder::StopPlayback() {
+}
+
+} // namespace