summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/animation.cc2
-rw-r--r--chrome/common/chrome_plugin_lib.cc2
-rw-r--r--chrome/common/ipc_logging.cc3
-rw-r--r--chrome/common/ipc_message_utils.h12
-rw-r--r--chrome/common/ipc_sync_channel.cc2
-rw-r--r--chrome/common/net/cookie_monster_sqlite.cc3
-rw-r--r--chrome/common/net/url_request_intercept_job.cc4
-rw-r--r--chrome/common/thumbnail_score.cc3
-rw-r--r--chrome/common/thumbnail_score.h6
-rw-r--r--chrome/common/time_format.cc3
-rw-r--r--chrome/common/time_format.h11
-rw-r--r--chrome/common/time_format_unittest.cc3
12 files changed, 37 insertions, 17 deletions
diff --git a/chrome/common/animation.cc b/chrome/common/animation.cc
index d407ccc..bf69812 100644
--- a/chrome/common/animation.cc
+++ b/chrome/common/animation.cc
@@ -5,6 +5,8 @@
#include "base/message_loop.h"
#include "chrome/common/animation.h"
+using base::TimeDelta;
+
Animation::Animation(int frame_rate,
AnimationDelegate* delegate)
: animating_(false),
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc
index ae8964d..642c623 100644
--- a/chrome/common/chrome_plugin_lib.cc
+++ b/chrome/common/chrome_plugin_lib.cc
@@ -18,6 +18,8 @@
#include "chrome/common/chrome_paths.h"
#include "webkit/glue/plugins/plugin_list.h"
+using base::TimeDelta;
+
const TCHAR ChromePluginLib::kRegistryChromePlugins[] =
_T("Software\\Google\\Chrome\\Plugins");
static const TCHAR kRegistryLoadOnStartup[] = _T("LoadOnStartup");
diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc
index 8199f84..db8bf84 100644
--- a/chrome/common/ipc_logging.cc
+++ b/chrome/common/ipc_logging.cc
@@ -18,6 +18,8 @@
#ifdef IPC_MESSAGE_LOG_ENABLED
+using base::Time;
+
// IPC::Logging is allocated as a singleton, so we don't need any kind of
// special retention program.
template <>
@@ -267,4 +269,3 @@ void GenerateLogData(const std::wstring& channel, const Message& message,
}
#endif // IPC_MESSAGE_LOG_ENABLED
-
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index d5531e2..23a6f06 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -238,8 +238,8 @@ struct ParamTraits<wchar_t> {
};
template <>
-struct ParamTraits<Time> {
- typedef Time param_type;
+struct ParamTraits<base::Time> {
+ typedef base::Time param_type;
static void Write(Message* m, const param_type& p) {
ParamTraits<int64>::Write(m, p.ToInternalValue());
}
@@ -247,7 +247,7 @@ struct ParamTraits<Time> {
int64 value;
if (!ParamTraits<int64>::Read(m, iter, &value))
return false;
- *r = Time::FromInternalValue(value);
+ *r = base::Time::FromInternalValue(value);
return true;
}
static void Log(const param_type& p, std::wstring* l) {
@@ -636,16 +636,16 @@ struct ParamTraits<ThumbnailScore> {
IPC::ParamTraits<double>::Write(m, p.boring_score);
IPC::ParamTraits<bool>::Write(m, p.good_clipping);
IPC::ParamTraits<bool>::Write(m, p.at_top);
- IPC::ParamTraits<Time>::Write(m, p.time_at_snapshot);
+ IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot);
}
static bool Read(const Message* m, void** iter, param_type* r) {
double boring_score;
bool good_clipping, at_top;
- Time time_at_snapshot;
+ base::Time time_at_snapshot;
if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) ||
!IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) ||
!IPC::ParamTraits<bool>::Read(m, iter, &at_top) ||
- !IPC::ParamTraits<Time>::Read(m, iter, &time_at_snapshot))
+ !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot))
return false;
r->boring_score = boring_score;
diff --git a/chrome/common/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc
index 1f60def..0861790 100644
--- a/chrome/common/ipc_sync_channel.cc
+++ b/chrome/common/ipc_sync_channel.cc
@@ -13,6 +13,8 @@
#include "chrome/common/ipc_logging.h"
#include "chrome/common/ipc_sync_message.h"
+using base::TimeDelta;
+using base::TimeTicks;
namespace IPC {
// When we're blocked in a Send(), we need to process incoming synchronous
diff --git a/chrome/common/net/cookie_monster_sqlite.cc b/chrome/common/net/cookie_monster_sqlite.cc
index 5f0f361..f4026d0 100644
--- a/chrome/common/net/cookie_monster_sqlite.cc
+++ b/chrome/common/net/cookie_monster_sqlite.cc
@@ -14,6 +14,8 @@
#include "chrome/common/sqlite_compiled_statement.h"
#include "chrome/common/sqlite_utils.h"
+using base::Time;
+
// This class is designed to be shared between any calling threads and the
// database thread. It batches operations and commits them on a timer.
class SQLitePersistentCookieStore::Backend
@@ -354,4 +356,3 @@ void SQLitePersistentCookieStore::DeleteCookie(
if (backend_.get())
backend_->DeleteCookie(cc);
}
-
diff --git a/chrome/common/net/url_request_intercept_job.cc b/chrome/common/net/url_request_intercept_job.cc
index 1b18a68..398f2b0 100644
--- a/chrome/common/net/url_request_intercept_job.cc
+++ b/chrome/common/net/url_request_intercept_job.cc
@@ -13,6 +13,9 @@
#include "chrome/common/chrome_plugin_lib.h"
#include "net/base/net_errors.h"
+using base::Time;
+using base::TimeDelta;
+
//
// URLRequestInterceptJob
//
@@ -207,4 +210,3 @@ void URLRequestInterceptJob::Observe(NotificationType type,
DetachPlugin();
}
-
diff --git a/chrome/common/thumbnail_score.cc b/chrome/common/thumbnail_score.cc
index 5a7cf90..72c6239 100644
--- a/chrome/common/thumbnail_score.cc
+++ b/chrome/common/thumbnail_score.cc
@@ -6,6 +6,9 @@
#include "base/logging.h"
+using base::Time;
+using base::TimeDelta;
+
const TimeDelta ThumbnailScore::kUpdateThumbnailTime = TimeDelta::FromDays(1);
const double ThumbnailScore::kThumbnailMaximumBoringness = 0.94;
const double ThumbnailScore::kThumbnailDegradePerHour = 0.01;
diff --git a/chrome/common/thumbnail_score.h b/chrome/common/thumbnail_score.h
index f6f83a9..6990726 100644
--- a/chrome/common/thumbnail_score.h
+++ b/chrome/common/thumbnail_score.h
@@ -19,7 +19,7 @@ struct ThumbnailScore {
// Builds a ThumbnailScore with the passed in values.
ThumbnailScore(double score, bool clipping, bool top,
- const Time& time);
+ const base::Time& time);
~ThumbnailScore();
// Tests for equivalence between two ThumbnailScore objects.
@@ -46,7 +46,7 @@ struct ThumbnailScore {
// Record the time when a thumbnail was taken. This is used to make
// sure thumbnails are kept fresh.
- Time time_at_snapshot;
+ base::Time time_at_snapshot;
// How bad a thumbnail needs to be before we completely ignore it.
static const double kThumbnailMaximumBoringness;
@@ -54,7 +54,7 @@ struct ThumbnailScore {
// Time before we take a worse thumbnail (subject to
// kThumbnailMaximumBoringness) over what's currently in the database
// for freshness.
- static const TimeDelta kUpdateThumbnailTime;
+ static const base::TimeDelta kUpdateThumbnailTime;
// Penalty of how much more boring a thumbnail should be per hour.
static const double kThumbnailDegradePerHour;
diff --git a/chrome/common/time_format.cc b/chrome/common/time_format.cc
index 39412ea..029aec0 100644
--- a/chrome/common/time_format.cc
+++ b/chrome/common/time_format.cc
@@ -21,6 +21,9 @@
#include "unicode/plurrule.h"
#include "unicode/smpdtfmt.h"
+using base::Time;
+using base::TimeDelta;
+
class TimeRemainingFormat {
public:
const std::vector<PluralFormat*>& formatter(bool short_version) {
diff --git a/chrome/common/time_format.h b/chrome/common/time_format.h
index 8704e01..252599b 100644
--- a/chrome/common/time_format.h
+++ b/chrome/common/time_format.h
@@ -11,8 +11,10 @@
#include "unicode/smpdtfmt.h"
+namespace base {
class Time;
class TimeDelta;
+}
class TimeFormat {
public:
@@ -20,10 +22,10 @@ class TimeFormat {
// are simpler than PastTime since this is used for in-progress operations
// and users have different expectations of units.
// Ex: "3 mins left", "2 days left".
- static std::wstring TimeRemaining(const TimeDelta& delta);
+ static std::wstring TimeRemaining(const base::TimeDelta& delta);
// Same as TimeRemaining without the "left".
- static std::wstring TimeRemainingShort(const TimeDelta& delta);
+ static std::wstring TimeRemainingShort(const base::TimeDelta& delta);
// For displaying a relative time in the past. This method returns either
// "Today", "Yesterday", or an empty string if it's older than that.
@@ -38,9 +40,8 @@ class TimeFormat {
// If NULL, the current day's midnight will be retrieved, which can be
// slow. If many items are being processed, it is best to get the current
// time once at the beginning and pass it for each computation.
- static std::wstring RelativeDate(const Time& time,
- const Time* optional_midnight_today);
+ static std::wstring RelativeDate(const base::Time& time,
+ const base::Time* optional_midnight_today);
};
#endif // CHROME_COMMON_TIME_FORMAT_H__
-
diff --git a/chrome/common/time_format_unittest.cc b/chrome/common/time_format_unittest.cc
index bb910cc..07119d1 100644
--- a/chrome/common/time_format_unittest.cc
+++ b/chrome/common/time_format_unittest.cc
@@ -10,6 +10,9 @@
#include "chrome/common/time_format.h"
#include "testing/gtest/include/gtest/gtest.h"
+using base::Time;
+using base::TimeDelta;
+
TEST(TimeFormat, RelativeDate) {
Time now = Time::Now();
std::wstring today_str = TimeFormat::RelativeDate(now, NULL);