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

Side by Side Diff: content/browser/service_worker/service_worker_context_watcher.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_context_watcher.h" 5 #include "content/browser/service_worker/service_worker_context_watcher.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "content/browser/service_worker/service_worker_context_observer.h" 11 #include "content/browser/service_worker/service_worker_context_observer.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 12 #include "content/browser/service_worker/service_worker_context_wrapper.h"
11 #include "content/browser/service_worker/service_worker_version.h" 13 #include "content/browser/service_worker/service_worker_version.h"
12 #include "content/common/service_worker/service_worker_types.h" 14 #include "content/common/service_worker/service_worker_types.h"
13 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
14 #include "content/public/common/console_message_level.h" 16 #include "content/public/common/console_message_level.h"
15 #include "url/gurl.h" 17 #include "url/gurl.h"
16 18
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 DCHECK_EQ(version->script_url, script_url); 170 DCHECK_EQ(version->script_url, script_url);
169 return; 171 return;
170 } 172 }
171 173
172 scoped_ptr<ServiceWorkerVersionInfo> version(new ServiceWorkerVersionInfo()); 174 scoped_ptr<ServiceWorkerVersionInfo> version(new ServiceWorkerVersionInfo());
173 version->version_id = version_id; 175 version->version_id = version_id;
174 version->registration_id = registration_id; 176 version->registration_id = registration_id;
175 version->script_url = script_url; 177 version->script_url = script_url;
176 SendVersionInfo(*version); 178 SendVersionInfo(*version);
177 if (!IsStoppedAndRedundant(*version)) 179 if (!IsStoppedAndRedundant(*version))
178 version_info_map_.set(version_id, version.Pass()); 180 version_info_map_.set(version_id, std::move(version));
179 } 181 }
180 182
181 void ServiceWorkerContextWatcher::OnRunningStateChanged( 183 void ServiceWorkerContextWatcher::OnRunningStateChanged(
182 int64_t version_id, 184 int64_t version_id,
183 content::ServiceWorkerVersion::RunningStatus running_status) { 185 content::ServiceWorkerVersion::RunningStatus running_status) {
184 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); 186 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id);
185 DCHECK(version); 187 DCHECK(version);
186 if (version->running_status == running_status) 188 if (version->running_status == running_status)
187 return; 189 return;
188 version->running_status = running_status; 190 version->running_status = running_status;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 context_->GetLiveRegistration(registration_id); 287 context_->GetLiveRegistration(registration_id);
286 if (!registration) 288 if (!registration)
287 return; 289 return;
288 std::vector<ServiceWorkerRegistrationInfo> registrations; 290 std::vector<ServiceWorkerRegistrationInfo> registrations;
289 registrations.push_back(registration->GetInfo()); 291 registrations.push_back(registration->GetInfo());
290 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 292 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
291 base::Bind(registration_callback_, registrations)); 293 base::Bind(registration_callback_, registrations));
292 } 294 }
293 295
294 } // namespace content 296 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698