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

Issue 3183004: AU: Switch GLib's timeout sources from milliseconds to seconds. (Closed)

Created:
10 years, 4 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Base URL:
http://src.chromium.org/git/update_engine.git
Visibility:
Public.

Description

AU: Switch GLib's timeout sources from milliseconds to seconds. There's no need for the extra resolution and seconds is preferred. BUG=5577 TEST=unit tests, gmerged on device and saw checks at 2 and 30 minutes. Change-Id: I6d64774d5a0e8961fbb9868edc42e62eb794ba11

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M libcurl_http_fetcher.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M main.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
petkov
10 years, 4 months ago (2010-08-13 19:41:29 UTC) #1
adlr
10 years, 4 months ago (2010-08-13 23:33:32 UTC) #2
LGTM

On Fri, Aug 13, 2010 at 12:41 PM, <petkov@chromium.org> wrote:

> Reviewers: adlr,
>
> Description:
> AU: Switch GLib's timeout sources from milliseconds to seconds.
>
> There's no need for the extra resolution and seconds is preferred.
>
> BUG=5577
> TEST=unit tests, gmerged on device and saw checks at 2 and 30 minutes.
>
> Change-Id: I6d64774d5a0e8961fbb9868edc42e62eb794ba11
>
> Please review this at http://codereview.chromium.org/3183004/show
>
> SVN Base: http://src.chromium.org/git/update_engine.git
>
> Affected files:
>  M libcurl_http_fetcher.cc
>  M main.cc
>
>
> Index: libcurl_http_fetcher.cc
> diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
> index
>
7bee4c176e322ded02b8b90a8d6298872cb52265..0707d999689b89429bd885b1d0503ae314a7908c
> 100644
> --- a/libcurl_http_fetcher.cc
> +++ b/libcurl_http_fetcher.cc
> @@ -112,9 +112,9 @@ void LibcurlHttpFetcher::CurlPerformOnce() {
>         if (delegate_)
>           delegate_->TransferComplete(this, false);  // success
>       } else {
> -        g_timeout_add(5 * 1000,
> -                      &LibcurlHttpFetcher::StaticRetryTimeoutCallback,
> -                      this);
> +        g_timeout_add_seconds(5,
> +
>  &LibcurlHttpFetcher::StaticRetryTimeoutCallback,
> +                              this);
>       }
>       return;
>     } else {
> @@ -229,7 +229,7 @@ void LibcurlHttpFetcher::SetupMainloopSources() {
>   }
>   if (!timeout_source_) {
>     LOG(INFO) << "setting up timeout source:" << ms;
> -    timeout_source_ = g_timeout_source_new(1000);
> +    timeout_source_ = g_timeout_source_new_seconds(1);
>     CHECK(timeout_source_);
>     g_source_set_callback(timeout_source_, StaticTimeoutCallback, this,
>                           NULL);
> Index: main.cc
> diff --git a/main.cc b/main.cc
> index
>
c196ed5be3f90e734f1731f6ba489c62dbcfe5b8..3ae1e4bec40b1e089e12e310918301d3c34ca92c
> 100644
> --- a/main.cc
> +++ b/main.cc
> @@ -60,8 +60,8 @@ void SchedulePeriodicUpdateChecks(UpdateAttempter*
> update_attempter) {
>
>   // Kick off periodic updating. First, update after 2 minutes. Also,
> update
>   // every 30 minutes.
> -  g_timeout_add(2 * 60 * 1000, &UpdateOnce, update_attempter);
> -  g_timeout_add(30 * 60 * 1000, &UpdatePeriodically, update_attempter);
> +  g_timeout_add_seconds(2 * 60, &UpdateOnce, update_attempter);
> +  g_timeout_add_seconds(30 * 60, &UpdatePeriodically, update_attempter);
>  }
>
>  void SetupDbusService(UpdateEngineService* service) {
>
>
>

Powered by Google App Engine
This is Rietveld 408576698