Index: Source/core/frame/Frame.cpp |
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp |
index 4f95ddfb6d8fea37c74c90f1e9df0369f3e741f3..1f5f159ab8b11121c048114cb3a73fa5c0fbd41b 100644 |
--- a/Source/core/frame/Frame.cpp |
+++ b/Source/core/frame/Frame.cpp |
@@ -53,6 +53,18 @@ namespace blink { |
using namespace HTMLNames; |
+namespace { |
+ |
+int64_t generateFrameID() |
+{ |
+ // Initialize to the current time to reduce the likelihood of generating |
+ // identifiers that overlap with those from past/future browser sessions. |
+ static int64_t next = static_cast<int64_t>(currentTime() * 1000000.0); |
chrishtr
2015/03/27 01:13:02
currentTime() is already in seconds, no?
MikeB
2015/04/14 18:05:45
Yes, it's making "next" start off at a very large
|
+ return ++next; |
+} |
+ |
+} // namespace |
+ |
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
Frame::~Frame() |
@@ -286,6 +298,7 @@ Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
, m_host(host) |
, m_owner(owner) |
, m_client(client) |
+ , m_frameID(generateFrameID()) |
, m_isLoading(false) |
{ |
ASSERT(page()); |