Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd6c29a

Browse filesBrowse files
committed
fix file path
1 parent e9f2484 commit fd6c29a
Copy full SHA for fd6c29a

2 files changed

+2-8Lines changed: 2 additions & 8 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/inspector/storage_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector/storage_agent.cc
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <string>
33
#include "env-inl.h"
44
#include "inspector/protocol_helper.h"
5+
#include "node_url.h"
56
#include "util-inl.h"
67
#include "v8-isolate.h"
78
#include "v8-local-handle.h"
@@ -20,16 +21,10 @@ void StorageAgent::Wire(protocol::UberDispatcher* dispatcher) {
2021
DispatchResponse StorageAgent::getStorageKey(
2122
std::optional<protocol::String> frameId, protocol::String* storageKey) {
2223
auto local_storage_file = env_->options()->localstorage_file;
23-
*storageKey = to_file_url(local_storage_file);
24+
*storageKey = node::url::FromFilePath(local_storage_file);
2425
return protocol::DispatchResponse::Success();
2526
}
2627

27-
std::string StorageAgent::to_file_url(const std::filesystem::path& input) {
28-
std::filesystem::path abs =
29-
std::filesystem::weakly_canonical(std::filesystem::absolute(input));
30-
return "file://" + abs.generic_string();
31-
}
32-
3328
} // namespace protocol
3429
} // namespace inspector
3530
} // namespace node
Collapse file

‎src/inspector/storage_agent.h‎

Copy file name to clipboardExpand all lines: src/inspector/storage_agent.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class StorageAgent : public protocol::Storage::Backend {
2626
private:
2727
std::unique_ptr<protocol::Storage::Frontend> frontend_;
2828
Environment* env_;
29-
std::string to_file_url(const std::filesystem::path& input);
3029
};
3130
} // namespace protocol
3231
} // namespace inspector

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.