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

Side by Side Diff: Source/web/WebSharedWorkerImpl.cpp

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 9 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 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 client()->workerScriptLoadFailed(); 344 client()->workerScriptLoadFailed();
345 return; 345 return;
346 } 346 }
347 WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerG lobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart; 347 WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerG lobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart;
348 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); 348 OwnPtr<WorkerClients> workerClients = WorkerClients::create();
349 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c reate()); 349 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c reate());
350 provideDatabaseClientToWorker(workerClients.get(), DatabaseClientImpl::creat e()); 350 provideDatabaseClientToWorker(workerClients.get(), DatabaseClientImpl::creat e());
351 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); 351 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin());
352 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin))); 352 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin)));
353 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat e(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->script(), star tMode, m_contentSecurityPolicy, static_cast<WebCore::ContentSecurityPolicy::Head erType>(m_policyType), workerClients.release()); 353 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat e(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->script(), star tMode, m_contentSecurityPolicy, static_cast<WebCore::ContentSecurityPolicy::Head erType>(m_policyType), workerClients.release());
354 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData .release())); 354 OwnPtr<WorkerSettings> settings = WorkerSettings::create();
355 if (client())
356 settings->setMemoryInfoEnabled(client()->enableMemoryInfo());
357 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, settings.re lease(), startupData.release()));
355 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script()); 358 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script());
356 m_mainScriptLoader.clear(); 359 m_mainScriptLoader.clear();
357 360
358 if (m_attachDevToolsOnStart) 361 if (m_attachDevToolsOnStart)
359 workerThread()->runLoop().postDebuggerTask(createCallbackTask(connectToW orkerContextInspectorTask, true)); 362 workerThread()->runLoop().postDebuggerTask(createCallbackTask(connectToW orkerContextInspectorTask, true));
360 363
361 workerThread()->start(); 364 workerThread()->start();
362 if (client()) 365 if (client())
363 client()->workerScriptLoaded(); 366 client()->workerScriptLoaded();
364 } 367 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp ectorBackendTask, String(message))); 434 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp ectorBackendTask, String(message)));
432 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); 435 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread());
433 } 436 }
434 437
435 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 438 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
436 { 439 {
437 return new WebSharedWorkerImpl(client); 440 return new WebSharedWorkerImpl(client);
438 } 441 }
439 442
440 } // namespace blink 443 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698