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

Issue 796393005: Cleanup: Remove if (!CurrentlyOn()) PostTask() pattern in EmbeddedWorkerInstance (Closed)

Created:
5 years, 11 months ago by kinuko
Modified:
5 years, 11 months ago
Reviewers:
horo
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cleanup: Remove if (!CurrentlyOn()) PostTask() pattern in EmbeddedWorkerInstance Per discussion on chromium-dev (https://groups.google.com/a/chromium.org/d/msg/chromium-dev/uWGNk-hVlGc/M92wu3izhGEJ) I'm removing following code pattern from non-thread-safe code. void DoSomething() { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(DoSomething); return; } ... } This pattern is handy, but this could mislead readers to think that the method can be called from any threads, while it's not. (We use similar patterns a lot in ServiceWorkerContextWrapper, but the class is intended to be thread-safe so I think the usage there should be ok) BUG=N/A TEST=existing tests Committed: https://crrev.com/6f6121790f0f4f5f97fc3b125b261f4e5efd8334 Cr-Commit-Position: refs/heads/master@{#310447}

Patch Set 1 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -73 lines) Patch
M content/browser/service_worker/embedded_worker_instance.h View 3 chunks +3 lines, -6 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 10 chunks +83 lines, -67 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
kinuko
Cleanup only, PTL
5 years, 11 months ago (2015-01-07 10:35:59 UTC) #3
horo
lgtm
5 years, 11 months ago (2015-01-07 14:47:33 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/796393005/20001
5 years, 11 months ago (2015-01-08 02:05:07 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:20001)
5 years, 11 months ago (2015-01-08 03:02:38 UTC) #7
commit-bot: I haz the power
5 years, 11 months ago (2015-01-08 03:03:19 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/6f6121790f0f4f5f97fc3b125b261f4e5efd8334
Cr-Commit-Position: refs/heads/master@{#310447}

Powered by Google App Engine
This is Rietveld 408576698