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

Side by Side Diff: Source/core/inspector/WorkerRuntimeAgent.cpp

Issue 400153002: Change WokerThread to use a blink::WebThread. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix issues from jochen's review. Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 19 matching lines...) Expand all
30 30
31 #include "config.h" 31 #include "config.h"
32 32
33 #include "core/inspector/WorkerRuntimeAgent.h" 33 #include "core/inspector/WorkerRuntimeAgent.h"
34 34
35 #include "bindings/core/v8/ScriptState.h" 35 #include "bindings/core/v8/ScriptState.h"
36 #include "core/inspector/InjectedScript.h" 36 #include "core/inspector/InjectedScript.h"
37 #include "core/inspector/InstrumentingAgents.h" 37 #include "core/inspector/InstrumentingAgents.h"
38 #include "core/inspector/WorkerDebuggerAgent.h" 38 #include "core/inspector/WorkerDebuggerAgent.h"
39 #include "core/workers/WorkerGlobalScope.h" 39 #include "core/workers/WorkerGlobalScope.h"
40 #include "core/workers/WorkerRunLoop.h"
41 #include "core/workers/WorkerThread.h" 40 #include "core/workers/WorkerThread.h"
42 41
43 namespace blink { 42 namespace blink {
44 43
45 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope) 44 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope)
46 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer) 45 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer)
47 , m_workerGlobalScope(workerGlobalScope) 46 , m_workerGlobalScope(workerGlobalScope)
48 , m_paused(false) 47 , m_paused(false)
49 { 48 {
50 } 49 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 *out_result = m_paused; 98 *out_result = m_paused;
100 } 99 }
101 100
102 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in t workerThreadStartMode) 101 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in t workerThreadStartMode)
103 { 102 {
104 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart) 103 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart)
105 return; 104 return;
106 105
107 m_paused = true; 106 m_paused = true;
108 MessageQueueWaitResult result; 107 MessageQueueWaitResult result;
108 context->thread()->willEnterNestedLoop();
109 do { 109 do {
110 result = context->thread()->runLoop().runDebuggerTask(); 110 result = context->thread()->runDebuggerTask();
111 // Keep waiting until execution is resumed. 111 // Keep waiting until execution is resumed.
112 } while (result == MessageQueueMessageReceived && m_paused); 112 } while (result == MessageQueueMessageReceived && m_paused);
113 context->thread()->didLeaveNestedLoop();
113 } 114 }
114 115
115 } // namespace blink 116 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698