GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — inspector: fix builds without SQLite · gabylb/node@3217ab1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/inspector
    • dom_storage_agent.cc
    • dom_storage_agent.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/inspector/dom_storage_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector/dom_storage_agent.cc
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "util.h"
66
#include "v8-exception.h"
77
#include "v8-isolate.h"
8+
#if HAVE_SQLITE
9+
#include "node_webstorage.h"
10+
#endif // HAVE_SQLITE
811

912
namespace node {
1013
namespace inspector {
@@ -98,6 +101,7 @@ protocol::DispatchResponse DOMStorageAgent::getDOMStorageItems(
98101
bool is_local_storage = storageId->getIsLocalStorage();
99102
const StorageMap* storage_map =
100103
is_local_storage ? &local_storage_map_ : &session_storage_map_;
104+
#if HAVE_SQLITE
101105
std::optional<StorageMap> storage_map_fallback;
102106
if (storage_map->empty()) {
103107
auto web_storage_obj = getWebStorage(is_local_storage);
@@ -139,6 +143,12 @@ protocol::DispatchResponse DOMStorageAgent::getDOMStorageItems(
139143
}
140144
storage_map = &storage_map_fallback.value();
141145
}
146+
#else
147+
if (storage_map->empty()) {
148+
return protocol::DispatchResponse::ServerError(
149+
"Could not read DOM storage items: storage is unavailable");
150+
}
151+
#endif // HAVE_SQLITE
142152

143153
auto result =
144154
std::make_unique<protocol::Array<protocol::Array<protocol::String>>>();
@@ -317,6 +327,7 @@ void DOMStorageAgent::registerStorage(Local<Context> context,
317327
}
318328
}
319329

330+
#if HAVE_SQLITE
320331
std::optional<node::webstorage::Storage*> DOMStorageAgent::getWebStorage(
321332
bool is_local_storage) {
322333
v8::Isolate* isolate = env_->isolate();
@@ -339,6 +350,7 @@ std::optional<node::webstorage::Storage*> DOMStorageAgent::getWebStorage(
339350
return storage;
340351
}
341352
}
353+
#endif // HAVE_SQLITE
342354

343355
bool DOMStorageAgent::canEmit(const std::string& domain) {
344356
return domain == "DOMStorage";
Collapse file

‎src/inspector/dom_storage_agent.h‎

Copy file name to clipboardExpand all lines: src/inspector/dom_storage_agent.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
#include <string>
66
#include "env.h"
77
#include "node/inspector/protocol/DOMStorage.h"
8-
#include "node_webstorage.h"
98
#include "notification_emitter.h"
109
#include "v8.h"
1110

1211
namespace node {
12+
namespace webstorage {
13+
class Storage;
14+
} // namespace webstorage
15+
1316
namespace inspector {
1417

1518
class DOMStorageAgent : public protocol::DOMStorage::Backend,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.