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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 void RemoveCallbackAndStopIfDoomed(IDMAP* callbacks, int request_id); | 471 void RemoveCallbackAndStopIfDoomed(IDMAP* callbacks, int request_id); |
472 | 472 |
473 template <typename CallbackType> | 473 template <typename CallbackType> |
474 int AddRequest(const CallbackType& callback, | 474 int AddRequest(const CallbackType& callback, |
475 IDMap<CallbackType, IDMapOwnPointer>* callback_map, | 475 IDMap<CallbackType, IDMapOwnPointer>* callback_map, |
476 RequestType request_type); | 476 RequestType request_type); |
477 | 477 |
478 bool OnRequestTimeout(const RequestInfo& info); | 478 bool OnRequestTimeout(const RequestInfo& info); |
479 void SetAllRequestTimes(const base::TimeTicks& ticks); | 479 void SetAllRequestTimes(const base::TimeTicks& ticks); |
480 | 480 |
| 481 // Returns the reason the embedded worker failed to start, using information |
| 482 // inaccessible to EmbeddedWorkerInstance. Returns |default_code| if it can't |
| 483 // deduce a reason. |
| 484 ServiceWorkerStatusCode DeduceStartWorkerFailureReason( |
| 485 ServiceWorkerStatusCode default_code); |
| 486 |
481 const int64 version_id_; | 487 const int64 version_id_; |
482 int64 registration_id_; | 488 int64 registration_id_; |
483 GURL script_url_; | 489 GURL script_url_; |
484 GURL scope_; | 490 GURL scope_; |
485 Status status_; | 491 Status status_; |
486 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; | 492 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; |
487 std::vector<StatusCallback> start_callbacks_; | 493 std::vector<StatusCallback> start_callbacks_; |
488 std::vector<StatusCallback> stop_callbacks_; | 494 std::vector<StatusCallback> stop_callbacks_; |
489 std::vector<base::Closure> status_change_callbacks_; | 495 std::vector<base::Closure> status_change_callbacks_; |
490 | 496 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; | 540 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; |
535 | 541 |
536 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 542 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
537 | 543 |
538 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 544 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
539 }; | 545 }; |
540 | 546 |
541 } // namespace content | 547 } // namespace content |
542 | 548 |
543 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 549 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |