| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |