Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/browser/service_worker/embedded_worker_instance.h" | 10 #include "content/browser/service_worker/embedded_worker_instance.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 ASSERT_FALSE(done_closure_.is_null()); | 105 ASSERT_FALSE(done_closure_.is_null()); |
| 106 last_worker_status_ = worker_->status(); | 106 last_worker_status_ = worker_->status(); |
| 107 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); | 107 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); |
| 108 } | 108 } |
| 109 virtual void OnStopped() OVERRIDE { | 109 virtual void OnStopped() OVERRIDE { |
| 110 ASSERT_TRUE(worker_ != NULL); | 110 ASSERT_TRUE(worker_ != NULL); |
| 111 ASSERT_FALSE(done_closure_.is_null()); | 111 ASSERT_FALSE(done_closure_.is_null()); |
| 112 last_worker_status_ = worker_->status(); | 112 last_worker_status_ = worker_->status(); |
| 113 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); | 113 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); |
| 114 } | 114 } |
| 115 virtual void OnMessageReceived(const IPC::Message& message) OVERRIDE {} | |
|
alecflett
2014/01/16 17:50:08
Maybe add a comment indicating that it's safe to i
kinuko
2014/01/17 03:18:54
Done. Added NOTREACHED()
| |
| 115 | 116 |
| 116 ServiceWorkerProviderHost* GetRegisteredProviderHost() { | 117 ServiceWorkerProviderHost* GetRegisteredProviderHost() { |
| 117 // Assumes only one provider host is registered at this point. | 118 // Assumes only one provider host is registered at this point. |
| 118 std::vector<ServiceWorkerProviderHost*> providers; | 119 std::vector<ServiceWorkerProviderHost*> providers; |
| 119 wrapper_->context()->GetAllProviderHosts(&providers); | 120 wrapper_->context()->GetAllProviderHosts(&providers); |
| 120 DCHECK_EQ(1U, providers.size()); | 121 DCHECK_EQ(1U, providers.size()); |
| 121 return providers[0]; | 122 return providers[0]; |
| 122 } | 123 } |
| 123 | 124 |
| 124 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; | 125 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 150 done_closure_ = stop_run_loop.QuitClosure(); | 151 done_closure_ = stop_run_loop.QuitClosure(); |
| 151 BrowserThread::PostTask( | 152 BrowserThread::PostTask( |
| 152 BrowserThread::IO, FROM_HERE, | 153 BrowserThread::IO, FROM_HERE, |
| 153 base::Bind(&self::StopEmbeddedWorkerOnIOThread, this)); | 154 base::Bind(&self::StopEmbeddedWorkerOnIOThread, this)); |
| 154 stop_run_loop.Run(); | 155 stop_run_loop.Run(); |
| 155 | 156 |
| 156 ASSERT_EQ(EmbeddedWorkerInstance::STOPPED, last_worker_status_); | 157 ASSERT_EQ(EmbeddedWorkerInstance::STOPPED, last_worker_status_); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace content | 160 } // namespace content |
| OLD | NEW |