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

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

Issue 982413002: base: Stop passing a non-const ref to ObserverListBase::Iterator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: observerref: fixwindowsbuild Created 5 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/embedded_worker_instance.h" 5 #include "content/browser/service_worker/embedded_worker_instance.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 void EmbeddedWorkerInstance::OnPausedAfterDownload() { 383 void EmbeddedWorkerInstance::OnPausedAfterDownload() {
384 // Stop can be requested before getting this far. 384 // Stop can be requested before getting this far.
385 if (status_ == STOPPING) 385 if (status_ == STOPPING)
386 return; 386 return;
387 DCHECK(status_ == STARTING); 387 DCHECK(status_ == STARTING);
388 FOR_EACH_OBSERVER(Listener, listener_list_, OnPausedAfterDownload()); 388 FOR_EACH_OBSERVER(Listener, listener_list_, OnPausedAfterDownload());
389 } 389 }
390 390
391 bool EmbeddedWorkerInstance::OnMessageReceived(const IPC::Message& message) { 391 bool EmbeddedWorkerInstance::OnMessageReceived(const IPC::Message& message) {
392 ListenerList::Iterator it(listener_list_); 392 ListenerList::Iterator it(&listener_list_);
393 while (Listener* listener = it.GetNext()) { 393 while (Listener* listener = it.GetNext()) {
394 if (listener->OnMessageReceived(message)) 394 if (listener->OnMessageReceived(message))
395 return true; 395 return true;
396 } 396 }
397 return false; 397 return false;
398 } 398 }
399 399
400 void EmbeddedWorkerInstance::OnReportException( 400 void EmbeddedWorkerInstance::OnReportException(
401 const base::string16& error_message, 401 const base::string16& error_message,
402 int line_number, 402 int line_number,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 case SCRIPT_EVALUATED: 479 case SCRIPT_EVALUATED:
480 return "Script evaluated"; 480 return "Script evaluated";
481 case STARTING_PHASE_MAX_VALUE: 481 case STARTING_PHASE_MAX_VALUE:
482 NOTREACHED(); 482 NOTREACHED();
483 } 483 }
484 NOTREACHED() << phase; 484 NOTREACHED() << phase;
485 return std::string(); 485 return std::string();
486 } 486 }
487 487
488 } // namespace content 488 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698