Index: third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp b/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp |
index 0b8db126ef5d80eaf6ed2fcee54694e550f7253b..e663ccbad44766cb8599c44b0f6eaf18487eefed 100644 |
--- a/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp |
+++ b/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp |
@@ -49,6 +49,16 @@ String IdentifiersFactory::CreateIdentifier() { |
// static |
String IdentifiersFactory::RequestId(unsigned long identifier) { |
+ // Odd request Ids are set by the browser. For those we use a PID of 0 |
+ // because for browser side navigations the PID may not be known when an event |
+ // is sent because the renderer hasn't been created yet. |
+ int signed_identifier = static_cast<int>(identifier); |
+ if (signed_identifier < 0) { |
+ StringBuilder builder; |
+ builder.Append("0."); |
+ builder.AppendNumber(signed_identifier); |
+ return builder.ToString(); |
+ } |
return identifier ? AddProcessIdPrefixTo(identifier) : String(); |
} |