Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: content/browser/service_worker/service_worker_version.h

Issue 1054033004: ServiceWorker: More accurate StartWorker result and UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 void AddListener(Listener* listener); 279 void AddListener(Listener* listener);
280 void RemoveListener(Listener* listener); 280 void RemoveListener(Listener* listener);
281 281
282 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } 282 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; }
283 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } 283 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); }
284 284
285 // Reports the error message to |listeners_|. 285 // Reports the error message to |listeners_|.
286 void ReportError(ServiceWorkerStatusCode status, 286 void ReportError(ServiceWorkerStatusCode status,
287 const std::string& status_message); 287 const std::string& status_message);
288 288
289 // Sets the status code to pass to StartWorker callbacks if start fails.
290 void SetStartWorkerStatusCode(ServiceWorkerStatusCode status);
291
289 // Sets this version's status to REDUNDANT and deletes its resources. 292 // Sets this version's status to REDUNDANT and deletes its resources.
290 // The version must not have controllees. 293 // The version must not have controllees.
291 void Doom(); 294 void Doom();
292 bool is_redundant() const { return status_ == REDUNDANT; } 295 bool is_redundant() const { return status_ == REDUNDANT; }
293 296
294 bool skip_waiting() const { return skip_waiting_; } 297 bool skip_waiting() const { return skip_waiting_; }
295 298
296 bool force_bypass_cache_for_scripts() { 299 bool force_bypass_cache_for_scripts() {
297 return force_bypass_cache_for_scripts_; 300 return force_bypass_cache_for_scripts_;
298 } 301 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 // callback map). 539 // callback map).
537 std::queue<RequestInfo> requests_; 540 std::queue<RequestInfo> requests_;
538 541
539 bool skip_waiting_ = false; 542 bool skip_waiting_ = false;
540 bool skip_recording_startup_time_ = false; 543 bool skip_recording_startup_time_ = false;
541 bool force_bypass_cache_for_scripts_ = false; 544 bool force_bypass_cache_for_scripts_ = false;
542 545
543 std::vector<int> pending_skip_waiting_requests_; 546 std::vector<int> pending_skip_waiting_requests_;
544 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; 547 scoped_ptr<net::HttpResponseInfo> main_script_http_info_;
545 548
549 // The status when StartWorker was invoked. Used for UMA.
550 Status prestart_status_ = NEW;
nhiroki 2015/04/24 04:58:28 How about binding "prestart status" to DidEnsureLi
falken 2015/04/24 05:08:26 I originally wanted to do this but there are Recor
nhiroki 2015/04/24 05:23:57 Oh... I see. Thank you for explanation. LGTM
551 // If not OK, the reason that StartWorker failed. Used for
552 // running |start_callbacks_|.
553 ServiceWorkerStatusCode start_worker_status_ = SERVICE_WORKER_OK;
554
546 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 555 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
547 556
548 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 557 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
549 }; 558 };
550 559
551 } // namespace content 560 } // namespace content
552 561
553 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 562 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698