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 "content/renderer/service_worker/service_worker_script_context.h" | 5 #include "content/renderer/service_worker/service_worker_script_context.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "content/child/notifications/notification_data_conversions.h" | 10 #include "content/child/notifications/notification_data_conversions.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (!callbacks) { | 407 if (!callbacks) { |
408 NOTREACHED() << "Got stray response: " << request_id; | 408 NOTREACHED() << "Got stray response: " << request_id; |
409 return; | 409 return; |
410 } | 410 } |
411 scoped_ptr<blink::WebServiceWorkerClientsInfo> info( | 411 scoped_ptr<blink::WebServiceWorkerClientsInfo> info( |
412 new blink::WebServiceWorkerClientsInfo); | 412 new blink::WebServiceWorkerClientsInfo); |
413 blink::WebVector<blink::WebServiceWorkerClientInfo> convertedClients( | 413 blink::WebVector<blink::WebServiceWorkerClientInfo> convertedClients( |
414 clients.size()); | 414 clients.size()); |
415 for (size_t i = 0; i < clients.size(); ++i) { | 415 for (size_t i = 0; i < clients.size(); ++i) { |
416 convertedClients[i].clientID = clients[i].client_id; | 416 convertedClients[i].clientID = clients[i].client_id; |
417 convertedClients[i].visibilityState = | 417 convertedClients[i].pageVisibilityState = clients[i].page_visibility_state; |
418 blink::WebString::fromUTF8(clients[i].visibility_state); | |
419 convertedClients[i].isFocused = clients[i].is_focused; | 418 convertedClients[i].isFocused = clients[i].is_focused; |
420 convertedClients[i].url = clients[i].url; | 419 convertedClients[i].url = clients[i].url; |
421 convertedClients[i].frameType = | 420 convertedClients[i].frameType = |
422 static_cast<blink::WebURLRequest::FrameType>(clients[i].frame_type); | 421 static_cast<blink::WebURLRequest::FrameType>(clients[i].frame_type); |
423 } | 422 } |
424 info->clients.swap(convertedClients); | 423 info->clients.swap(convertedClients); |
425 callbacks->onSuccess(info.release()); | 424 callbacks->onSuccess(info.release()); |
426 pending_clients_callbacks_.Remove(request_id); | 425 pending_clients_callbacks_.Remove(request_id); |
427 } | 426 } |
428 | 427 |
(...skipping 18 matching lines...) Expand all Loading... |
447 pending_skip_waiting_callbacks_.Lookup(request_id); | 446 pending_skip_waiting_callbacks_.Lookup(request_id); |
448 if (!callbacks) { | 447 if (!callbacks) { |
449 NOTREACHED() << "Got stray response: " << request_id; | 448 NOTREACHED() << "Got stray response: " << request_id; |
450 return; | 449 return; |
451 } | 450 } |
452 callbacks->onSuccess(); | 451 callbacks->onSuccess(); |
453 pending_skip_waiting_callbacks_.Remove(request_id); | 452 pending_skip_waiting_callbacks_.Remove(request_id); |
454 } | 453 } |
455 | 454 |
456 } // namespace content | 455 } // namespace content |
OLD | NEW |