Skip to content

Commit 24e6ffc

Browse files
committed
Fix nwjs#2854: dom_storage_quota
1 parent beefeb9 commit 24e6ffc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/renderer/shell_content_renderer_client.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ void ShellContentRendererClient::RenderThreadStarted() {
115115
base::SetCurrentDirectory(
116116
command_line->GetSwitchValuePath(switches::kWorkingDirectory));
117117
}
118+
119+
if (command_line->HasSwitch(switches::kDomStorageQuota)) {
120+
std::string quota_str = command_line->GetSwitchValueASCII(switches::kDomStorageQuota);
121+
int quota = 0;
122+
if (base::StringToInt(quota_str, &quota) && quota > 0) {
123+
content::DOMStorageMap::SetQuotaOverride(quota * 1024 * 1024);
124+
}
125+
}
126+
118127
#if 0
119128
int argc = 1;
120129
char* argv[] = { const_cast<char*>("node"), NULL, NULL };
@@ -135,13 +144,6 @@ void ShellContentRendererClient::RenderThreadStarted() {
135144
snapshot_path = command_line->GetSwitchValuePath(switches::kSnapshot).AsUTF8Unsafe();
136145
}
137146

138-
if (command_line->HasSwitch(switches::kDomStorageQuota)) {
139-
std::string quota_str = command_line->GetSwitchValueASCII(switches::kDomStorageQuota);
140-
int quota = 0;
141-
if (base::StringToInt(quota_str, &quota) && quota > 0) {
142-
content::DOMStorageMap::SetQuotaOverride(quota * 1024 * 1024);
143-
}
144-
}
145147
// Initialize node after render thread is started.
146148
if (!snapshot_path.empty()) {
147149
v8::V8::Initialize(); //FIXME

0 commit comments

Comments
 (0)