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

Side by Side Diff: content/browser/service_worker/service_worker_url_request_job.cc

Issue 1155043002: Record send_start timing info after starting ServiceWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/service_worker/service_worker_url_request_job.h" 5 #include "content/browser/service_worker/service_worker_url_request_job.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // Send a fetch event to the ServiceWorker associated to the 350 // Send a fetch event to the ServiceWorker associated to the
351 // provider_host. 351 // provider_host.
352 fetch_dispatcher_.reset(new ServiceWorkerFetchDispatcher( 352 fetch_dispatcher_.reset(new ServiceWorkerFetchDispatcher(
353 CreateFetchRequest(), 353 CreateFetchRequest(),
354 provider_host_->active_version(), 354 provider_host_->active_version(),
355 base::Bind(&ServiceWorkerURLRequestJob::DidPrepareFetchEvent, 355 base::Bind(&ServiceWorkerURLRequestJob::DidPrepareFetchEvent,
356 weak_factory_.GetWeakPtr()), 356 weak_factory_.GetWeakPtr()),
357 base::Bind(&ServiceWorkerURLRequestJob::DidDispatchFetchEvent, 357 base::Bind(&ServiceWorkerURLRequestJob::DidDispatchFetchEvent,
358 weak_factory_.GetWeakPtr()))); 358 weak_factory_.GetWeakPtr())));
359 fetch_start_time_ = base::TimeTicks::Now(); 359 fetch_start_time_ = base::TimeTicks::Now();
360 load_timing_info_.send_start = fetch_start_time_;
361 fetch_dispatcher_->Run(); 360 fetch_dispatcher_->Run();
362 return; 361 return;
363 } 362 }
364 363
365 NOTREACHED(); 364 NOTREACHED();
366 } 365 }
367 366
368 scoped_ptr<ServiceWorkerFetchRequest> 367 scoped_ptr<ServiceWorkerFetchRequest>
369 ServiceWorkerURLRequestJob::CreateFetchRequest() { 368 ServiceWorkerURLRequestJob::CreateFetchRequest() {
370 std::string blob_uuid; 369 std::string blob_uuid;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 466
468 request_body_blob_data_handle_ = 467 request_body_blob_data_handle_ =
469 blob_storage_context_->AddFinishedBlob(&blob_builder); 468 blob_storage_context_->AddFinishedBlob(&blob_builder);
470 *blob_uuid = uuid; 469 *blob_uuid = uuid;
471 *blob_size = total_size; 470 *blob_size = total_size;
472 return true; 471 return true;
473 } 472 }
474 473
475 void ServiceWorkerURLRequestJob::DidPrepareFetchEvent() { 474 void ServiceWorkerURLRequestJob::DidPrepareFetchEvent() {
476 fetch_ready_time_ = base::TimeTicks::Now(); 475 fetch_ready_time_ = base::TimeTicks::Now();
476 load_timing_info_.send_start = fetch_ready_time_;
477 } 477 }
478 478
479 void ServiceWorkerURLRequestJob::DidDispatchFetchEvent( 479 void ServiceWorkerURLRequestJob::DidDispatchFetchEvent(
480 ServiceWorkerStatusCode status, 480 ServiceWorkerStatusCode status,
481 ServiceWorkerFetchEventResult fetch_result, 481 ServiceWorkerFetchEventResult fetch_result,
482 const ServiceWorkerResponse& response, 482 const ServiceWorkerResponse& response,
483 scoped_refptr<ServiceWorkerVersion> version) { 483 scoped_refptr<ServiceWorkerVersion> version) {
484 fetch_dispatcher_.reset(); 484 fetch_dispatcher_.reset();
485 485
486 // Check if we're not orphaned. 486 // Check if we're not orphaned.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 647 }
648 if (!waiting_stream_url_.is_empty()) { 648 if (!waiting_stream_url_.is_empty()) {
649 StreamRegistry* stream_registry = 649 StreamRegistry* stream_registry =
650 GetStreamContextForResourceContext(resource_context_)->registry(); 650 GetStreamContextForResourceContext(resource_context_)->registry();
651 stream_registry->RemoveRegisterObserver(waiting_stream_url_); 651 stream_registry->RemoveRegisterObserver(waiting_stream_url_);
652 stream_registry->AbortPendingStream(waiting_stream_url_); 652 stream_registry->AbortPendingStream(waiting_stream_url_);
653 } 653 }
654 } 654 }
655 655
656 } // namespace content 656 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698