Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
| index 5efe20ac9f2ba29ec73f3c29b48ef7efc25b9bf3..3f96a2fd1fa42788a8cf4cf54a99d4160224f98e 100644 |
| --- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
| @@ -341,9 +341,9 @@ void InspectorPageAgent::restore() |
| enable(&error); |
| setBlockedEventsWarningThreshold(&error, m_state->doubleProperty(PageAgentState::blockedEventsWarningThreshold, 0.0)); |
| if (m_client) { |
| - String16 overlayMessage; |
| + String overlayMessage; |
| m_state->getString(PageAgentState::overlayMessage, &overlayMessage); |
| - m_client->configureOverlay(m_state->booleanProperty(PageAgentState::overlaySuspended, false), overlayMessage.isEmpty() ? String() : String(overlayMessage)); |
| + m_client->configureOverlay(m_state->booleanProperty(PageAgentState::overlaySuspended, false), overlayMessage.isEmpty() ? String() : overlayMessage); |
|
caseq
2016/08/26 19:17:20
remove ternary operator, just use overlayMessage d
dgozman
2016/08/26 21:31:26
Empty and null is not the same thing, but it shoul
|
| } |
| } |
| @@ -512,7 +512,11 @@ void InspectorPageAgent::searchContentAfterResourcesContentLoaded(const String& |
| return; |
| } |
| - callback->sendSuccess(m_v8Session->searchInTextByLines(toV8InspectorStringView(content), toV8InspectorStringView(query), caseSensitive, isRegex)); |
| + auto matches = m_v8Session->searchInTextByLines(toV8InspectorStringView(content), toV8InspectorStringView(query), caseSensitive, isRegex); |
| + auto results = protocol::Array<v8_inspector::protocol::Debugger::API::SearchMatch>::create(); |
| + for (size_t i = 0; i < matches.size(); ++i) |
| + results->addItem(std::move(matches[i])); |
| + callback->sendSuccess(std::move(results)); |
| } |
| void InspectorPageAgent::searchInResource(const String& frameId, const String& url, const String& query, const Maybe<bool>& optionalCaseSensitive, const Maybe<bool>& optionalIsRegex, std::unique_ptr<SearchInResourceCallback> callback) |
| @@ -549,7 +553,7 @@ void InspectorPageAgent::didClearDocumentOfWindowObject(LocalFrame* frame) |
| if (scripts) { |
| for (size_t i = 0; i < scripts->size(); ++i) { |
| auto script = scripts->at(i); |
| - String16 scriptText; |
| + String scriptText; |
| if (script.second->asString(&scriptText)) |
| frame->script().executeScriptInMainWorld(scriptText); |
| } |