Index: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp |
index 18d5ae9e3876d36ff7fc3e1a1823ea627bfb571d..b843aeb76e50c45d514be0613d4edbfbfe667340 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp |
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp |
@@ -49,13 +49,6 @@ static const char customObjectFormatterEnabled[] = "customObjectFormatterEnabled |
using protocol::Runtime::ExceptionDetails; |
using protocol::Runtime::RemoteObject; |
-static bool checkInternalError(ErrorString* errorString, bool success) |
-{ |
- if (!success) |
- *errorString = "Internal error"; |
- return success; |
-} |
- |
PassOwnPtr<V8RuntimeAgent> V8RuntimeAgent::create(V8Debugger* debugger, int contextGroupId) |
{ |
return adoptPtr(new V8RuntimeAgentImpl(static_cast<V8DebuggerImpl*>(debugger), contextGroupId)); |
@@ -250,15 +243,15 @@ void V8RuntimeAgentImpl::getProperties( |
if (object->IsSymbol()) |
return; |
v8::Local<v8::Array> propertiesArray; |
- if (!checkInternalError(errorString, v8::Debug::GetInternalProperties(injectedScript->isolate(), object).ToLocal(&propertiesArray))) |
+ if (hasInternalError(errorString, !v8::Debug::GetInternalProperties(injectedScript->isolate(), object).ToLocal(&propertiesArray))) |
return; |
OwnPtr<protocol::Array<InternalPropertyDescriptor>> propertiesProtocolArray = protocol::Array<InternalPropertyDescriptor>::create(); |
for (uint32_t i = 0; i < propertiesArray->Length(); i += 2) { |
v8::Local<v8::Value> name; |
- if (!checkInternalError(errorString, propertiesArray->Get(injectedScript->context(), i).ToLocal(&name)) && name->IsString()) |
+ if (hasInternalError(errorString, !propertiesArray->Get(injectedScript->context(), i).ToLocal(&name)) || !name->IsString()) |
return; |
v8::Local<v8::Value> value; |
- if (!checkInternalError(errorString, propertiesArray->Get(injectedScript->context(), i + 1).ToLocal(&value))) |
+ if (hasInternalError(errorString, !propertiesArray->Get(injectedScript->context(), i + 1).ToLocal(&value))) |
return; |
OwnPtr<RemoteObject> wrappedValue = injectedScript->wrapObject(errorString, value, objectGroupName); |
if (!wrappedValue) |
@@ -541,4 +534,11 @@ void V8RuntimeAgentImpl::reportExecutionContextDestroyed(v8::Local<v8::Context> |
m_frontend->executionContextDestroyed(contextId); |
} |
+bool V8RuntimeAgentImpl::hasInternalError(ErrorString* errorString, bool isError) |
+{ |
+ if (isError) |
+ *errorString = "Internal error"; |
+ return isError; |
+} |
+ |
} // namespace blink |