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/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 *time = base::TimeTicks().Now(); | 256 *time = base::TimeTicks().Now(); |
257 } | 257 } |
258 | 258 |
259 base::TimeDelta GetTickDuration(const base::TimeTicks& time) { | 259 base::TimeDelta GetTickDuration(const base::TimeTicks& time) { |
260 if (time.is_null()) | 260 if (time.is_null()) |
261 return base::TimeDelta(); | 261 return base::TimeDelta(); |
262 return base::TimeTicks().Now() - time; | 262 return base::TimeTicks().Now() - time; |
263 } | 263 } |
264 | 264 |
265 void OnGetClientsFromUI( | 265 void OnGetClientsFromUI( |
266 // The tuple contains process_id, frame_id, client_id. | 266 // The tuple contains process_id, frame_id, client_uuid. |
267 const std::vector<Tuple<int,int,int>>& clients_info, | 267 const std::vector<Tuple<int,int,std::string>>& clients_info, |
268 const GURL& script_url, | 268 const GURL& script_url, |
269 const GetClientsCallback& callback) { | 269 const GetClientsCallback& callback) { |
270 std::vector<ServiceWorkerClientInfo> clients; | 270 std::vector<ServiceWorkerClientInfo> clients; |
271 | 271 |
272 for (const auto& it : clients_info) { | 272 for (const auto& it : clients_info) { |
273 ServiceWorkerClientInfo info = | 273 ServiceWorkerClientInfo info = |
274 ServiceWorkerProviderHost::GetClientInfoOnUI(get<0>(it), get<1>(it)); | 274 ServiceWorkerProviderHost::GetClientInfoOnUI(get<0>(it), get<1>(it)); |
275 | 275 |
276 // If the request to the provider_host returned an empty | 276 // If the request to the provider_host returned an empty |
277 // ServiceWorkerClientInfo, that means that it wasn't possible to associate | 277 // ServiceWorkerClientInfo, that means that it wasn't possible to associate |
278 // it with a valid RenderFrameHost. It might be because the frame was killed | 278 // it with a valid RenderFrameHost. It might be because the frame was killed |
279 // or navigated in between. | 279 // or navigated in between. |
280 if (info.IsEmpty()) | 280 if (info.IsEmpty()) |
281 continue; | 281 continue; |
282 | 282 |
283 // We can get info for a frame that was navigating end ended up with a | 283 // We can get info for a frame that was navigating end ended up with a |
284 // different URL than expected. In such case, we should make sure to not | 284 // different URL than expected. In such case, we should make sure to not |
285 // expose cross-origin WindowClient. | 285 // expose cross-origin WindowClient. |
286 if (info.url.GetOrigin() != script_url.GetOrigin()) | 286 if (info.url.GetOrigin() != script_url.GetOrigin()) |
287 return; | 287 return; |
288 | 288 |
289 info.client_id = get<2>(it); | 289 info.client_uuid = get<2>(it); |
290 clients.push_back(info); | 290 clients.push_back(info); |
291 } | 291 } |
292 | 292 |
293 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 293 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
294 base::Bind(callback, clients)); | 294 base::Bind(callback, clients)); |
295 } | 295 } |
296 | 296 |
297 } // namespace | 297 } // namespace |
298 | 298 |
299 ServiceWorkerVersion::ServiceWorkerVersion( | 299 ServiceWorkerVersion::ServiceWorkerVersion( |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 std::vector<int> new_routing_ids; | 724 std::vector<int> new_routing_ids; |
725 filter->UpdateMessagePortsWithNewRoutes(sent_message_ports, &new_routing_ids); | 725 filter->UpdateMessagePortsWithNewRoutes(sent_message_ports, &new_routing_ids); |
726 ServiceWorkerStatusCode status = | 726 ServiceWorkerStatusCode status = |
727 embedded_worker_->SendMessage(ServiceWorkerMsg_CrossOriginMessageToWorker( | 727 embedded_worker_->SendMessage(ServiceWorkerMsg_CrossOriginMessageToWorker( |
728 client, message, sent_message_ports, new_routing_ids)); | 728 client, message, sent_message_ports, new_routing_ids)); |
729 RunSoon(base::Bind(callback, status)); | 729 RunSoon(base::Bind(callback, status)); |
730 } | 730 } |
731 | 731 |
732 void ServiceWorkerVersion::AddControllee( | 732 void ServiceWorkerVersion::AddControllee( |
733 ServiceWorkerProviderHost* provider_host) { | 733 ServiceWorkerProviderHost* provider_host) { |
734 DCHECK(!ContainsKey(controllee_map_, provider_host)); | 734 const std::string& uuid = provider_host->client_uuid(); |
735 int controllee_id = controllee_by_id_.Add(provider_host); | 735 CHECK(!provider_host->client_uuid().empty()); |
736 // IDMap<>'s last index is kInvalidServiceWorkerClientId. | 736 DCHECK(!ContainsKey(controllee_map_, uuid)); |
737 CHECK(controllee_id != kInvalidServiceWorkerClientId); | 737 controllee_map_[uuid] = provider_host; |
738 controllee_map_[provider_host] = controllee_id; | |
739 // Keep the worker alive a bit longer right after a new controllee is added. | 738 // Keep the worker alive a bit longer right after a new controllee is added. |
740 RestartTick(&idle_time_); | 739 RestartTick(&idle_time_); |
741 } | 740 } |
742 | 741 |
743 void ServiceWorkerVersion::RemoveControllee( | 742 void ServiceWorkerVersion::RemoveControllee( |
744 ServiceWorkerProviderHost* provider_host) { | 743 ServiceWorkerProviderHost* provider_host) { |
745 ControlleeMap::iterator found = controllee_map_.find(provider_host); | 744 const std::string& uuid = provider_host->client_uuid(); |
746 DCHECK(found != controllee_map_.end()); | 745 DCHECK(ContainsKey(controllee_map_, uuid)); |
747 controllee_by_id_.Remove(found->second); | 746 controllee_map_.erase(uuid); |
748 controllee_map_.erase(found); | |
749 if (HasControllee()) | 747 if (HasControllee()) |
750 return; | 748 return; |
751 FOR_EACH_OBSERVER(Listener, listeners_, OnNoControllees(this)); | 749 FOR_EACH_OBSERVER(Listener, listeners_, OnNoControllees(this)); |
752 if (is_doomed_) { | 750 if (is_doomed_) { |
753 DoomInternal(); | 751 DoomInternal(); |
754 return; | 752 return; |
755 } | 753 } |
756 } | 754 } |
757 | 755 |
758 void ServiceWorkerVersion::AddStreamingURLRequestJob( | 756 void ServiceWorkerVersion::AddStreamingURLRequestJob( |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GeofencingEventFinished, | 935 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GeofencingEventFinished, |
938 OnGeofencingEventFinished) | 936 OnGeofencingEventFinished) |
939 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CrossOriginConnectEventFinished, | 937 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CrossOriginConnectEventFinished, |
940 OnCrossOriginConnectEventFinished) | 938 OnCrossOriginConnectEventFinished) |
941 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_OpenWindow, | 939 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_OpenWindow, |
942 OnOpenWindow) | 940 OnOpenWindow) |
943 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SetCachedMetadata, | 941 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SetCachedMetadata, |
944 OnSetCachedMetadata) | 942 OnSetCachedMetadata) |
945 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ClearCachedMetadata, | 943 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ClearCachedMetadata, |
946 OnClearCachedMetadata) | 944 OnClearCachedMetadata) |
947 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_PostMessageToDocument, | 945 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_PostMessageToClient, |
948 OnPostMessageToDocument) | 946 OnPostMessageToClient) |
949 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_FocusClient, | 947 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_FocusClient, |
950 OnFocusClient) | 948 OnFocusClient) |
951 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SkipWaiting, | 949 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SkipWaiting, |
952 OnSkipWaiting) | 950 OnSkipWaiting) |
953 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ClaimClients, | 951 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ClaimClients, |
954 OnClaimClients) | 952 OnClaimClients) |
955 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_Pong, OnPongFromWorker) | 953 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_Pong, OnPongFromWorker) |
956 IPC_MESSAGE_UNHANDLED(handled = false) | 954 IPC_MESSAGE_UNHANDLED(handled = false) |
957 IPC_END_MESSAGE_MAP() | 955 IPC_END_MESSAGE_MAP() |
958 return handled; | 956 return handled; |
(...skipping 30 matching lines...) Expand all Loading... |
989 if (status != SERVICE_WORKER_OK) { | 987 if (status != SERVICE_WORKER_OK) { |
990 activate_callbacks_.Remove(request_id); | 988 activate_callbacks_.Remove(request_id); |
991 RunSoon(base::Bind(callback, status)); | 989 RunSoon(base::Bind(callback, status)); |
992 } | 990 } |
993 } | 991 } |
994 | 992 |
995 void ServiceWorkerVersion::OnGetClients( | 993 void ServiceWorkerVersion::OnGetClients( |
996 int request_id, | 994 int request_id, |
997 const ServiceWorkerClientQueryOptions& /* options */) { | 995 const ServiceWorkerClientQueryOptions& /* options */) { |
998 // TODO(kinuko): Handle ClientQueryOptions. (crbug.com/455241, 460415 etc) | 996 // TODO(kinuko): Handle ClientQueryOptions. (crbug.com/455241, 460415 etc) |
999 if (controllee_by_id_.IsEmpty()) { | 997 if (controllee_map_.empty()) { |
1000 if (running_status() == RUNNING) { | 998 if (running_status() == RUNNING) { |
1001 embedded_worker_->SendMessage( | 999 embedded_worker_->SendMessage( |
1002 ServiceWorkerMsg_DidGetClients(request_id, | 1000 ServiceWorkerMsg_DidGetClients(request_id, |
1003 std::vector<ServiceWorkerClientInfo>())); | 1001 std::vector<ServiceWorkerClientInfo>())); |
1004 } | 1002 } |
1005 return; | 1003 return; |
1006 } | 1004 } |
1007 | 1005 |
1008 TRACE_EVENT0("ServiceWorker", | 1006 TRACE_EVENT0("ServiceWorker", |
1009 "ServiceWorkerVersion::OnGetClients"); | 1007 "ServiceWorkerVersion::OnGetClients"); |
1010 | 1008 |
1011 std::vector<Tuple<int,int,int>> clients_info; | 1009 std::vector<Tuple<int,int,std::string>> clients_info; |
1012 for (ControlleeByIDMap::iterator it(&controllee_by_id_); !it.IsAtEnd(); | 1010 for (auto& controllee : controllee_map_) { |
1013 it.Advance()) { | 1011 int process_id = controllee.second->process_id(); |
1014 int process_id = it.GetCurrentValue()->process_id(); | 1012 int frame_id = controllee.second->frame_id(); |
1015 int frame_id = it.GetCurrentValue()->frame_id(); | 1013 const std::string& client_uuid = controllee.first; |
1016 int client_id = it.GetCurrentKey(); | |
1017 | 1014 |
1018 clients_info.push_back(MakeTuple(process_id, frame_id, client_id)); | 1015 clients_info.push_back(MakeTuple(process_id, frame_id, client_uuid)); |
1019 } | 1016 } |
1020 | 1017 |
1021 BrowserThread::PostTask( | 1018 BrowserThread::PostTask( |
1022 BrowserThread::UI, FROM_HERE, | 1019 BrowserThread::UI, FROM_HERE, |
1023 base::Bind(&OnGetClientsFromUI, clients_info, script_url_, | 1020 base::Bind(&OnGetClientsFromUI, clients_info, script_url_, |
1024 base::Bind(&ServiceWorkerVersion::DidGetClients, | 1021 base::Bind(&ServiceWorkerVersion::DidGetClients, |
1025 weak_factory_.GetWeakPtr(), | 1022 weak_factory_.GetWeakPtr(), |
1026 request_id))); | 1023 request_id))); |
1027 | 1024 |
1028 } | 1025 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 if (running_status() != RUNNING) | 1212 if (running_status() != RUNNING) |
1216 return; | 1213 return; |
1217 | 1214 |
1218 if (render_process_id == ChildProcessHost::kInvalidUniqueID && | 1215 if (render_process_id == ChildProcessHost::kInvalidUniqueID && |
1219 render_frame_id == MSG_ROUTING_NONE) { | 1216 render_frame_id == MSG_ROUTING_NONE) { |
1220 embedded_worker_->SendMessage(ServiceWorkerMsg_OpenWindowError(request_id)); | 1217 embedded_worker_->SendMessage(ServiceWorkerMsg_OpenWindowError(request_id)); |
1221 return; | 1218 return; |
1222 } | 1219 } |
1223 | 1220 |
1224 for (const auto& it : controllee_map_) { | 1221 for (const auto& it : controllee_map_) { |
1225 const ServiceWorkerProviderHost* provider_host = it.first; | 1222 const ServiceWorkerProviderHost* provider_host = it.second; |
1226 if (provider_host->process_id() != render_process_id || | 1223 if (provider_host->process_id() != render_process_id || |
1227 provider_host->frame_id() != render_frame_id) { | 1224 provider_host->frame_id() != render_frame_id) { |
1228 continue; | 1225 continue; |
1229 } | 1226 } |
1230 | 1227 |
1231 // it.second is the client_id associated with the provider_host. | 1228 // it.second is the client_uuid associated with the provider_host. |
1232 provider_host->GetClientInfo( | 1229 provider_host->GetClientInfo( |
1233 base::Bind(&ServiceWorkerVersion::OnOpenWindowFinished, | 1230 base::Bind(&ServiceWorkerVersion::OnOpenWindowFinished, |
1234 weak_factory_.GetWeakPtr(), request_id, it.second)); | 1231 weak_factory_.GetWeakPtr(), request_id, it.first)); |
1235 return; | 1232 return; |
1236 } | 1233 } |
1237 | 1234 |
1238 // If here, it means that no provider_host was found, in which case, the | 1235 // If here, it means that no provider_host was found, in which case, the |
1239 // renderer should still be informed that the window was opened. | 1236 // renderer should still be informed that the window was opened. |
1240 OnOpenWindowFinished(request_id, 0, ServiceWorkerClientInfo()); | 1237 OnOpenWindowFinished(request_id, std::string(), ServiceWorkerClientInfo()); |
1241 } | 1238 } |
1242 | 1239 |
1243 void ServiceWorkerVersion::OnOpenWindowFinished( | 1240 void ServiceWorkerVersion::OnOpenWindowFinished( |
1244 int request_id, | 1241 int request_id, |
1245 int client_id, | 1242 const std::string& client_uuid, |
1246 const ServiceWorkerClientInfo& client_info) { | 1243 const ServiceWorkerClientInfo& client_info) { |
1247 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1244 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1248 | 1245 |
1249 if (running_status() != RUNNING) | 1246 if (running_status() != RUNNING) |
1250 return; | 1247 return; |
1251 | 1248 |
1252 ServiceWorkerClientInfo client(client_info); | 1249 ServiceWorkerClientInfo client(client_info); |
1253 | 1250 |
1254 // If the |client_info| is empty, it means that the opened window wasn't | 1251 // If the |client_info| is empty, it means that the opened window wasn't |
1255 // controlled but the action still succeeded. The renderer process is | 1252 // controlled but the action still succeeded. The renderer process is |
1256 // expecting an empty client in such case. | 1253 // expecting an empty client in such case. |
1257 if (!client.IsEmpty()) | 1254 if (!client.IsEmpty()) |
1258 client.client_id = client_id; | 1255 client.client_uuid = client_uuid; |
1259 | 1256 |
1260 embedded_worker_->SendMessage(ServiceWorkerMsg_OpenWindowResponse( | 1257 embedded_worker_->SendMessage(ServiceWorkerMsg_OpenWindowResponse( |
1261 request_id, client)); | 1258 request_id, client)); |
1262 } | 1259 } |
1263 | 1260 |
1264 void ServiceWorkerVersion::OnSetCachedMetadata(const GURL& url, | 1261 void ServiceWorkerVersion::OnSetCachedMetadata(const GURL& url, |
1265 const std::vector<char>& data) { | 1262 const std::vector<char>& data) { |
1266 int64 callback_id = base::TimeTicks::Now().ToInternalValue(); | 1263 int64 callback_id = base::TimeTicks::Now().ToInternalValue(); |
1267 TRACE_EVENT_ASYNC_BEGIN1("ServiceWorker", | 1264 TRACE_EVENT_ASYNC_BEGIN1("ServiceWorker", |
1268 "ServiceWorkerVersion::OnSetCachedMetadata", | 1265 "ServiceWorkerVersion::OnSetCachedMetadata", |
(...skipping 22 matching lines...) Expand all Loading... |
1291 } | 1288 } |
1292 | 1289 |
1293 void ServiceWorkerVersion::OnClearCachedMetadataFinished(int64 callback_id, | 1290 void ServiceWorkerVersion::OnClearCachedMetadataFinished(int64 callback_id, |
1294 int result) { | 1291 int result) { |
1295 TRACE_EVENT_ASYNC_END1("ServiceWorker", | 1292 TRACE_EVENT_ASYNC_END1("ServiceWorker", |
1296 "ServiceWorkerVersion::OnClearCachedMetadata", | 1293 "ServiceWorkerVersion::OnClearCachedMetadata", |
1297 callback_id, "result", result); | 1294 callback_id, "result", result); |
1298 FOR_EACH_OBSERVER(Listener, listeners_, OnCachedMetadataUpdated(this)); | 1295 FOR_EACH_OBSERVER(Listener, listeners_, OnCachedMetadataUpdated(this)); |
1299 } | 1296 } |
1300 | 1297 |
1301 void ServiceWorkerVersion::OnPostMessageToDocument( | 1298 void ServiceWorkerVersion::OnPostMessageToClient( |
1302 int client_id, | 1299 const std::string& client_uuid, |
1303 const base::string16& message, | 1300 const base::string16& message, |
1304 const std::vector<TransferredMessagePort>& sent_message_ports) { | 1301 const std::vector<TransferredMessagePort>& sent_message_ports) { |
1305 TRACE_EVENT1("ServiceWorker", | 1302 TRACE_EVENT1("ServiceWorker", |
1306 "ServiceWorkerVersion::OnPostMessageToDocument", | 1303 "ServiceWorkerVersion::OnPostMessageToDocument", |
1307 "Client id", client_id); | 1304 "Client id", client_uuid); |
1308 ServiceWorkerProviderHost* provider_host = | 1305 auto it = controllee_map_.find(client_uuid); |
1309 controllee_by_id_.Lookup(client_id); | 1306 if (it == controllee_map_.end()) { |
1310 if (!provider_host) { | |
1311 // The client may already have been closed, just ignore. | 1307 // The client may already have been closed, just ignore. |
1312 return; | 1308 return; |
1313 } | 1309 } |
1314 provider_host->PostMessage(message, sent_message_ports); | 1310 if (it->second->document_url().GetOrigin() != script_url_.GetOrigin()) { |
| 1311 // The client does not belong to the same origin as this ServiceWorker, |
| 1312 // possibly due to timing issue or bad message. |
| 1313 return; |
| 1314 } |
| 1315 it->second->PostMessage(message, sent_message_ports); |
1315 } | 1316 } |
1316 | 1317 |
1317 void ServiceWorkerVersion::OnFocusClient(int request_id, int client_id) { | 1318 void ServiceWorkerVersion::OnFocusClient(int request_id, |
| 1319 const std::string& client_uuid) { |
1318 TRACE_EVENT2("ServiceWorker", | 1320 TRACE_EVENT2("ServiceWorker", |
1319 "ServiceWorkerVersion::OnFocusClient", | 1321 "ServiceWorkerVersion::OnFocusClient", |
1320 "Request id", request_id, | 1322 "Request id", request_id, |
1321 "Client id", client_id); | 1323 "Client id", client_uuid); |
1322 ServiceWorkerProviderHost* provider_host = | 1324 auto it = controllee_map_.find(client_uuid); |
1323 controllee_by_id_.Lookup(client_id); | 1325 if (it == controllee_map_.end()) { |
1324 if (!provider_host) { | |
1325 // The client may already have been closed, just ignore. | 1326 // The client may already have been closed, just ignore. |
1326 return; | 1327 return; |
1327 } | 1328 } |
| 1329 if (it->second->document_url().GetOrigin() != script_url_.GetOrigin()) { |
| 1330 // The client does not belong to the same origin as this ServiceWorker, |
| 1331 // possibly due to timing issue or bad message. |
| 1332 return; |
| 1333 } |
1328 | 1334 |
1329 provider_host->Focus( | 1335 it->second->Focus( |
1330 base::Bind(&ServiceWorkerVersion::OnFocusClientFinished, | 1336 base::Bind(&ServiceWorkerVersion::OnFocusClientFinished, |
1331 weak_factory_.GetWeakPtr(), | 1337 weak_factory_.GetWeakPtr(), |
1332 request_id, | 1338 request_id, |
1333 client_id)); | 1339 client_uuid)); |
1334 } | 1340 } |
1335 | 1341 |
1336 void ServiceWorkerVersion::OnFocusClientFinished( | 1342 void ServiceWorkerVersion::OnFocusClientFinished( |
1337 int request_id, | 1343 int request_id, |
1338 int cliend_id, | 1344 const std::string& cliend_uuid, |
1339 const ServiceWorkerClientInfo& client) { | 1345 const ServiceWorkerClientInfo& client) { |
1340 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1346 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1341 | 1347 |
1342 if (running_status() != RUNNING) | 1348 if (running_status() != RUNNING) |
1343 return; | 1349 return; |
1344 | 1350 |
1345 ServiceWorkerClientInfo client_info(client); | 1351 ServiceWorkerClientInfo client_info(client); |
1346 client_info.client_id = cliend_id; | 1352 client_info.client_uuid = cliend_uuid; |
1347 | 1353 |
1348 embedded_worker_->SendMessage(ServiceWorkerMsg_FocusClientResponse( | 1354 embedded_worker_->SendMessage(ServiceWorkerMsg_FocusClientResponse( |
1349 request_id, client_info)); | 1355 request_id, client_info)); |
1350 } | 1356 } |
1351 | 1357 |
1352 void ServiceWorkerVersion::OnSkipWaiting(int request_id) { | 1358 void ServiceWorkerVersion::OnSkipWaiting(int request_id) { |
1353 skip_waiting_ = true; | 1359 skip_waiting_ = true; |
1354 if (status_ != INSTALLED) | 1360 if (status_ != INSTALLED) |
1355 return DidSkipWaiting(request_id); | 1361 return DidSkipWaiting(request_id); |
1356 | 1362 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 int request_id) { | 1596 int request_id) { |
1591 callbacks->Remove(request_id); | 1597 callbacks->Remove(request_id); |
1592 if (is_doomed_) { | 1598 if (is_doomed_) { |
1593 // The stop should be already scheduled, but try to stop immediately, in | 1599 // The stop should be already scheduled, but try to stop immediately, in |
1594 // order to release worker resources soon. | 1600 // order to release worker resources soon. |
1595 StopWorkerIfIdle(); | 1601 StopWorkerIfIdle(); |
1596 } | 1602 } |
1597 } | 1603 } |
1598 | 1604 |
1599 } // namespace content | 1605 } // namespace content |
OLD | NEW |