| OLD | NEW |
| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 { | 241 { |
| 242 ASSERT(frame); | 242 ASSERT(frame); |
| 243 | 243 |
| 244 if (!m_preprocessorSourceCode || !frame->page() || isCreatingPreprocessor) | 244 if (!m_preprocessorSourceCode || !frame->page() || isCreatingPreprocessor) |
| 245 return false; | 245 return false; |
| 246 | 246 |
| 247 // We delay the creation of the preprocessor until just before the first JS
from the | 247 // We delay the creation of the preprocessor until just before the first JS
from the |
| 248 // Web page to ensure that the debugger's console initialization code has co
mpleted. | 248 // Web page to ensure that the debugger's console initialization code has co
mpleted. |
| 249 if (!m_scriptPreprocessor) { | 249 if (!m_scriptPreprocessor) { |
| 250 TemporaryChange<bool> isPreprocessing(isCreatingPreprocessor, true); | 250 TemporaryChange<bool> isPreprocessing(isCreatingPreprocessor, true); |
| 251 m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(*m_preprocessorSo
urceCode.get(), frame->script(), frame->host()->console())); | 251 m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(*m_preprocessorSo
urceCode.get(), frame)); |
| 252 } | 252 } |
| 253 | 253 |
| 254 if (m_scriptPreprocessor->isValid()) | 254 if (m_scriptPreprocessor->isValid()) |
| 255 return true; | 255 return true; |
| 256 | 256 |
| 257 m_scriptPreprocessor.clear(); | 257 m_scriptPreprocessor.clear(); |
| 258 // Don't retry the compile if we fail one time. | 258 // Don't retry the compile if we fail one time. |
| 259 m_preprocessorSourceCode.clear(); | 259 m_preprocessorSourceCode.clear(); |
| 260 return false; | 260 return false; |
| 261 } | 261 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 272 | 272 |
| 273 String PageScriptDebugServer::preprocessEventListener(Frame* frame, const String
& source, const String& url, const String& functionName) | 273 String PageScriptDebugServer::preprocessEventListener(Frame* frame, const String
& source, const String& url, const String& functionName) |
| 274 { | 274 { |
| 275 if (!canPreprocess(frame)) | 275 if (!canPreprocess(frame)) |
| 276 return source; | 276 return source; |
| 277 | 277 |
| 278 return m_scriptPreprocessor->preprocessSourceCode(source, url, functionName)
; | 278 return m_scriptPreprocessor->preprocessSourceCode(source, url, functionName)
; |
| 279 } | 279 } |
| 280 | 280 |
| 281 } // namespace WebCore | 281 } // namespace WebCore |
| OLD | NEW |