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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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 9c6aca3117d6cee362021f6b2d0087b8ce3fa668..2e2beba511c04f87137064d1b6cf1c9948594226 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -57,6 +57,7 @@
#include "core/inspector/InspectorCSSAgent.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorResourceContentLoader.h"
+#include "core/inspector/V8InspectorStringConversion.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
#include "platform/MIMETypeRegistry.h"
@@ -351,9 +352,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/19 02:50:36 remove ternary operator here.
}
}
@@ -522,7 +523,11 @@ void InspectorPageAgent::searchContentAfterResourcesContentLoaded(const String&
return;
}
- callback->sendSuccess(m_v8Session->searchInTextByLines(content, query, caseSensitive, isRegex));
+ std::vector<std::unique_ptr<v8_inspector::protocol::Debugger::API::SearchMatch>> matches = m_v8Session->searchInTextByLines(toV8InspectorString(content), toV8InspectorString(query), caseSensitive, isRegex);
+ std::unique_ptr<protocol::Array<v8_inspector::protocol::Debugger::API::SearchMatch>> results = protocol::Array<v8_inspector::protocol::Debugger::API::SearchMatch>::create();
caseq 2016/08/19 02:50:36 auto results = ....::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)
@@ -559,7 +564,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);
}

Powered by Google App Engine
This is Rietveld 408576698