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

Unified Diff: third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp

Issue 2004243002: Migrate websockets from url+lineNumber to SourceLocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@more-source-location-1
Patch Set: rebased Created 4 years, 7 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/modules/websockets/WebSocketChannel.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
index 70f0d7bf104cb5bbc59c969a951b81865251a624..49e46a182541c4ccf13584d80a3bad87818a0d18 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
@@ -30,7 +30,7 @@
#include "modules/websockets/WebSocketChannel.h"
-#include "bindings/core/v8/ScriptCallStack.h"
+#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -46,21 +46,15 @@ WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC
ASSERT(context);
ASSERT(client);
- String sourceURL;
- unsigned lineNumber = 0;
- RefPtr<ScriptCallStack> callStack = ScriptCallStack::capture(1);
- if (callStack && !callStack->isEmpty()) {
- sourceURL = callStack->topSourceURL();
- lineNumber = callStack->topLineNumber();
- }
+ OwnPtr<SourceLocation> location = SourceLocation::capture(context);
if (context->isWorkerGlobalScope()) {
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
- return WorkerWebSocketChannel::create(*workerGlobalScope, client, sourceURL, lineNumber);
+ return WorkerWebSocketChannel::create(*workerGlobalScope, client, std::move(location));
}
Document* document = toDocument(context);
- return DocumentWebSocketChannel::create(document, client, sourceURL, lineNumber);
+ return DocumentWebSocketChannel::create(document, client, std::move(location));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698