Commit 01c835bf authored by Staphany Park's avatar Staphany Park Committed by Commit Bot

AppCache: Simplify AppCacheBackendImpl::RegisterHost checks.

Bug: 611938
Change-Id: I5231a54ef35fc2aee6d36e83d65b1674df58cbd0
Reviewed-on: https://chromium-review.googlesource.com/c/1462425
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Staphany Park <staphany@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630691}
parent cc7ecdb3
...@@ -32,6 +32,12 @@ AppCacheBackendImpl::~AppCacheBackendImpl() { ...@@ -32,6 +32,12 @@ AppCacheBackendImpl::~AppCacheBackendImpl() {
} }
void AppCacheBackendImpl::RegisterHost(int32_t id, int32_t render_frame_id) { void AppCacheBackendImpl::RegisterHost(int32_t id, int32_t render_frame_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (GetHost(id)) {
mojo::ReportBadMessage("ACDH_REGISTER");
return;
}
// The AppCacheHost could have been precreated in which case we want to // The AppCacheHost could have been precreated in which case we want to
// register it with the backend here. // register it with the backend here.
std::unique_ptr<AppCacheHost> host = std::unique_ptr<AppCacheHost> host =
...@@ -40,12 +46,6 @@ void AppCacheBackendImpl::RegisterHost(int32_t id, int32_t render_frame_id) { ...@@ -40,12 +46,6 @@ void AppCacheBackendImpl::RegisterHost(int32_t id, int32_t render_frame_id) {
RegisterPrecreatedHost(std::move(host), render_frame_id); RegisterPrecreatedHost(std::move(host), render_frame_id);
return; return;
} }
if (GetHost(id)) {
mojo::ReportBadMessage("ACDH_REGISTER");
return;
}
hosts_[id] = std::make_unique<AppCacheHost>(id, process_id(), render_frame_id, hosts_[id] = std::make_unique<AppCacheHost>(id, process_id(), render_frame_id,
frontend_, service_); frontend_, service_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment