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

Side by Side Diff: Source/WebCore/inspector/InspectorDebuggerAgent.cpp

Issue 8371003: Merge 97851 - Web Inspector: Enable caseSensitive search / Regex support in advanced search. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 2 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) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. 3 * Copyright (C) 2010-2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 static PassRefPtr<InspectorObject> scriptToInspectorObject(ScriptObject scriptOb ject) 314 static PassRefPtr<InspectorObject> scriptToInspectorObject(ScriptObject scriptOb ject)
315 { 315 {
316 if (scriptObject.hasNoValue()) 316 if (scriptObject.hasNoValue())
317 return 0; 317 return 0;
318 RefPtr<InspectorValue> value = scriptObject.toInspectorValue(scriptObject.sc riptState()); 318 RefPtr<InspectorValue> value = scriptObject.toInspectorValue(scriptObject.sc riptState());
319 if (!value) 319 if (!value)
320 return 0; 320 return 0;
321 return value->asObject(); 321 return value->asObject();
322 } 322 }
323 323
324 void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& s criptId, const String& query, RefPtr<InspectorArray>* results) 324 void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& s criptId, const String& query, const bool* const optionalCaseSensitive, const boo l* const optionalIsRegex, RefPtr<InspectorArray>* results)
325 { 325 {
326 bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
327 bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
328
326 ScriptsMap::iterator it = m_scripts.find(scriptId); 329 ScriptsMap::iterator it = m_scripts.find(scriptId);
327 if (it != m_scripts.end()) 330 if (it != m_scripts.end())
328 *results = ContentSearchUtils::searchInTextByLines(query, it->second.sou rce); 331 *results = ContentSearchUtils::searchInTextByLines(it->second.source, qu ery, caseSensitive, isRegex);
329 else 332 else
330 *error = "No script for id: " + scriptId; 333 *error = "No script for id: " + scriptId;
331 } 334 }
332 335
333 void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& s criptId, const String& newContent, const bool* const preview, RefPtr<InspectorAr ray>* newCallFrames, RefPtr<InspectorObject>* result) 336 void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& s criptId, const String& newContent, const bool* const preview, RefPtr<InspectorAr ray>* newCallFrames, RefPtr<InspectorObject>* result)
334 { 337 {
335 bool previewOnly = preview && *preview; 338 bool previewOnly = preview && *preview;
336 ScriptObject resultObject; 339 ScriptObject resultObject;
337 if (!scriptDebugServer().setScriptSource(scriptId, newContent, previewOnly, error, &m_currentCallStack, &resultObject)) 340 if (!scriptDebugServer().setScriptSource(scriptId, newContent, previewOnly, error, &m_currentCallStack, &resultObject))
338 return; 341 return;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 545
543 void InspectorDebuggerAgent::clearBreakDetails() 546 void InspectorDebuggerAgent::clearBreakDetails()
544 { 547 {
545 m_breakReason = "other"; 548 m_breakReason = "other";
546 m_breakAuxData = 0; 549 m_breakAuxData = 0;
547 } 550 }
548 551
549 } // namespace WebCore 552 } // namespace WebCore
550 553
551 #endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) 554 #endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « Source/WebCore/inspector/InspectorDebuggerAgent.h ('k') | Source/WebCore/inspector/InspectorPageAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698