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

Side by Side Diff: Source/bindings/v8/PageScriptDebugServer.cpp

Issue 19284011: Apply ScriptPreprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase, fix Mac compiler issue Created 7 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (global.IsEmpty()) 57 if (global.IsEmpty())
58 return 0; 58 return 0;
59 59
60 global = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context- >GetIsolate(), worldTypeInMainThread(context->GetIsolate()))); 60 global = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context- >GetIsolate(), worldTypeInMainThread(context->GetIsolate())));
61 if (global.IsEmpty()) 61 if (global.IsEmpty())
62 return 0; 62 return 0;
63 63
64 return toFrameIfNotDetached(context); 64 return toFrameIfNotDetached(context);
65 } 65 }
66 66
67 ScriptController* PageScriptDebugServer::scriptController(v8::Handle<v8::Context > context)
68 {
69 Frame* frame = retrieveFrameWithGlobalObjectCheck(context);
70 if (frame)
71 return frame->script();
72 return 0;
73 }
74
67 PageScriptDebugServer& PageScriptDebugServer::shared() 75 PageScriptDebugServer& PageScriptDebugServer::shared()
68 { 76 {
69 DEFINE_STATIC_LOCAL(PageScriptDebugServer, server, ()); 77 DEFINE_STATIC_LOCAL(PageScriptDebugServer, server, ());
70 return server; 78 return server;
71 } 79 }
72 80
73 PageScriptDebugServer::PageScriptDebugServer() 81 PageScriptDebugServer::PageScriptDebugServer()
74 : ScriptDebugServer(v8::Isolate::GetCurrent()) 82 : ScriptDebugServer(v8::Isolate::GetCurrent())
75 , m_pausedPage(0) 83 , m_pausedPage(0)
76 { 84 {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 v8::HandleScope scope; 183 v8::HandleScope scope;
176 Frame* frame = retrieveFrameWithGlobalObjectCheck(context); 184 Frame* frame = retrieveFrameWithGlobalObjectCheck(context);
177 m_pausedPage = frame->page(); 185 m_pausedPage = frame->page();
178 186
179 // Wait for continue or step command. 187 // Wait for continue or step command.
180 m_clientMessageLoop->run(m_pausedPage); 188 m_clientMessageLoop->run(m_pausedPage);
181 189
182 // The listener may have been removed in the nested loop. 190 // The listener may have been removed in the nested loop.
183 if (ScriptDebugListener* listener = m_listenersMap.get(m_pausedPage)) 191 if (ScriptDebugListener* listener = m_listenersMap.get(m_pausedPage))
184 listener->didContinue(); 192 listener->didContinue();
185 193
186 m_pausedPage = 0; 194 m_pausedPage = 0;
187 } 195 }
188 196
189 void PageScriptDebugServer::quitMessageLoopOnPause() 197 void PageScriptDebugServer::quitMessageLoopOnPause()
190 { 198 {
191 m_clientMessageLoop->quitNow(); 199 m_clientMessageLoop->quitNow();
192 } 200 }
193 201
194 } // namespace WebCore 202 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698