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

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

Issue 692003002: ServiceWorker: Registering a malformed script should fail [1/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address falken@'s comments Created 6 years, 1 month 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // ~WorkerScriptController. 313 // ~WorkerScriptController.
314 blink::Platform::current()->didStartWorkerRunLoop(blink::WebWorkerRunLoop(th is)); 314 blink::Platform::current()->didStartWorkerRunLoop(blink::WebWorkerRunLoop(th is));
315 315
316 // Notify proxy that a new WorkerGlobalScope has been created and started. 316 // Notify proxy that a new WorkerGlobalScope has been created and started.
317 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); 317 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get());
318 318
319 WorkerScriptController* script = m_workerGlobalScope->script(); 319 WorkerScriptController* script = m_workerGlobalScope->script();
320 if (!script->isExecutionForbidden()) 320 if (!script->isExecutionForbidden())
321 script->initializeContextIfNeeded(); 321 script->initializeContextIfNeeded();
322 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode); 322 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode);
323 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); 323 bool success = script->evaluate(ScriptSourceCode(sourceCode, scriptURL));
324 m_workerGlobalScope->didEvaluateWorkerScript(); 324 m_workerGlobalScope->didEvaluateWorkerScript();
325 325
326 // Notify proxy that a worker script has been evaluated.
tkent 2014/11/05 02:10:22 This comment is helpless. Please remove it.
nhiroki 2014/11/05 03:09:48 Done.
327 m_workerReportingProxy.workerScriptEvaluated(success);
328
326 postInitialize(); 329 postInitialize();
327 330
328 postDelayedTask(createSameThreadTask(&WorkerThread::idleHandler, this), kSho rtIdleHandlerDelayMs); 331 postDelayedTask(createSameThreadTask(&WorkerThread::idleHandler, this), kSho rtIdleHandlerDelayMs);
329 } 332 }
330 333
331 void WorkerThread::cleanup() 334 void WorkerThread::cleanup()
332 { 335 {
333 336
334 // This should be called before we start the shutdown procedure. 337 // This should be called before we start the shutdown procedure.
335 workerReportingProxy().willDestroyWorkerGlobalScope(); 338 workerReportingProxy().willDestroyWorkerGlobalScope();
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 529 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
527 } 530 }
528 531
529 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 532 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
530 { 533 {
531 MutexLocker locker(m_workerInspectorControllerMutex); 534 MutexLocker locker(m_workerInspectorControllerMutex);
532 m_workerInspectorController = workerInspectorController; 535 m_workerInspectorController = workerInspectorController;
533 } 536 }
534 537
535 } // namespace blink 538 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698