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

Side by Side Diff: third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp

Issue 2647643004: Report nav timing 2 instance as soon as it's requested. (Closed)
Patch Set: make ResourceTimingInfo ref-counted Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (!m_client) 406 if (!m_client)
407 return; 407 return;
408 m_client->didDownloadData(dataLength); 408 m_client->didDownloadData(dataLength);
409 } 409 }
410 410
411 void WorkerThreadableLoader::didReceiveResourceTiming( 411 void WorkerThreadableLoader::didReceiveResourceTiming(
412 std::unique_ptr<CrossThreadResourceTimingInfoData> timingData) { 412 std::unique_ptr<CrossThreadResourceTimingInfoData> timingData) {
413 DCHECK(!isMainThread()); 413 DCHECK(!isMainThread());
414 if (!m_client) 414 if (!m_client)
415 return; 415 return;
416 std::unique_ptr<ResourceTimingInfo> info( 416 RefPtr<ResourceTimingInfo> info(
417 ResourceTimingInfo::adopt(std::move(timingData))); 417 ResourceTimingInfo::adopt(std::move(timingData)));
418 WorkerGlobalScopePerformance::performance(*m_workerGlobalScope) 418 WorkerGlobalScopePerformance::performance(*m_workerGlobalScope)
419 ->addResourceTiming(*info); 419 ->addResourceTiming(*info);
420 m_client->didReceiveResourceTiming(*info); 420 m_client->didReceiveResourceTiming(*info);
421 } 421 }
422 422
423 DEFINE_TRACE(WorkerThreadableLoader) { 423 DEFINE_TRACE(WorkerThreadableLoader) {
424 visitor->trace(m_workerGlobalScope); 424 visitor->trace(m_workerGlobalScope);
425 ThreadableLoader::trace(visitor); 425 ThreadableLoader::trace(visitor);
426 } 426 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 const ResourceLoaderOptions& originalResourceLoaderOptions) { 665 const ResourceLoaderOptions& originalResourceLoaderOptions) {
666 DCHECK(isMainThread()); 666 DCHECK(isMainThread());
667 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; 667 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions;
668 resourceLoaderOptions.requestInitiatorContext = WorkerContext; 668 resourceLoaderOptions.requestInitiatorContext = WorkerContext;
669 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options, 669 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options,
670 resourceLoaderOptions); 670 resourceLoaderOptions);
671 m_mainThreadLoader->start(ResourceRequest(request.get())); 671 m_mainThreadLoader->start(ResourceRequest(request.get()));
672 } 672 }
673 673
674 } // namespace blink 674 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698