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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: fix crash 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 KURL scriptURL = startupData->m_scriptURL; 443 KURL scriptURL = startupData->m_scriptURL;
444 String sourceCode = startupData->m_sourceCode; 444 String sourceCode = startupData->m_sourceCode;
445 WorkerThreadStartMode startMode = startupData->m_startMode; 445 WorkerThreadStartMode startMode = startupData->m_startMode;
446 std::unique_ptr<Vector<char>> cachedMetaData = 446 std::unique_ptr<Vector<char>> cachedMetaData =
447 std::move(startupData->m_cachedMetaData); 447 std::move(startupData->m_cachedMetaData);
448 V8CacheOptions v8CacheOptions = 448 V8CacheOptions v8CacheOptions =
449 startupData->m_workerV8Settings.m_v8CacheOptions; 449 startupData->m_workerV8Settings.m_v8CacheOptions;
450 bool heapLimitIncreasedForDebugging = 450 bool heapLimitIncreasedForDebugging =
451 startupData->m_workerV8Settings.m_heapLimitMode == 451 startupData->m_workerV8Settings.m_heapLimitMode ==
452 WorkerV8Settings::HeapLimitMode::IncreasedForDebugging; 452 WorkerV8Settings::HeapLimitMode::IncreasedForDebugging;
453 bool inspectorNetworkCapability = startupData->m_inspectorNetworkCapability;
453 454
454 { 455 {
455 MutexLocker lock(m_threadStateMutex); 456 MutexLocker lock(m_threadStateMutex);
456 457
457 if (isOwningBackingThread()) 458 if (isOwningBackingThread())
458 workerBackingThread().initialize(); 459 workerBackingThread().initialize();
459 workerBackingThread().backingThread().addTaskObserver(this); 460 workerBackingThread().backingThread().addTaskObserver(this);
460 461
461 // Optimize for memory usage instead of latency for the worker isolate. 462 // Optimize for memory usage instead of latency for the worker isolate.
462 isolate()->IsolateInBackgroundNotification(); 463 isolate()->IsolateInBackgroundNotification();
463 464
464 if (heapLimitIncreasedForDebugging) { 465 if (heapLimitIncreasedForDebugging) {
465 isolate()->IncreaseHeapLimitForDebugging(); 466 isolate()->IncreaseHeapLimitForDebugging();
466 } 467 }
467 468
468 m_consoleMessageStorage = new ConsoleMessageStorage(); 469 m_consoleMessageStorage = new ConsoleMessageStorage();
469 m_globalScope = createWorkerGlobalScope(std::move(startupData)); 470 m_globalScope = createWorkerGlobalScope(std::move(startupData));
470 m_workerReportingProxy.didCreateWorkerGlobalScope(globalScope()); 471 m_workerReportingProxy.didCreateWorkerGlobalScope(globalScope());
471 m_workerInspectorController = WorkerInspectorController::create(this); 472 m_workerInspectorController =
473 WorkerInspectorController::create(this, inspectorNetworkCapability);
472 474
473 // TODO(nhiroki): Handle a case where the script controller fails to 475 // TODO(nhiroki): Handle a case where the script controller fails to
474 // initialize the context. 476 // initialize the context.
475 if (globalScope()->scriptController()->initializeContextIfNeeded()) { 477 if (globalScope()->scriptController()->initializeContextIfNeeded()) {
476 m_workerReportingProxy.didInitializeWorkerContext(); 478 m_workerReportingProxy.didInitializeWorkerContext();
477 v8::HandleScope handleScope(isolate()); 479 v8::HandleScope handleScope(isolate());
478 Platform::current()->workerContextCreated( 480 Platform::current()->workerContextCreated(
479 globalScope()->scriptController()->context()); 481 globalScope()->scriptController()->context());
480 } 482 }
481 483
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 MutexLocker lock(m_threadStateMutex); 650 MutexLocker lock(m_threadStateMutex);
649 return m_requestedToTerminate; 651 return m_requestedToTerminate;
650 } 652 }
651 653
652 ExitCode WorkerThread::getExitCodeForTesting() { 654 ExitCode WorkerThread::getExitCodeForTesting() {
653 MutexLocker lock(m_threadStateMutex); 655 MutexLocker lock(m_threadStateMutex);
654 return m_exitCode; 656 return m_exitCode;
655 } 657 }
656 658
657 } // namespace blink 659 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698