Skip to content

Commit 9e5b3ad

Browse files
committed
move GrantUniversalPermissions to Content
1 parent b62e273 commit 9e5b3ad

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

src/api/api_messages.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,5 @@ IPC_MESSAGE_CONTROL0(ShellViewMsg_Reopen)
9898
// clear cache on the renderer side
9999
IPC_MESSAGE_CONTROL0(ShellViewMsg_ClearCache)
100100

101-
// grant the policy permissions
102-
IPC_SYNC_MESSAGE_ROUTED0_1(ShellViewHostMsg_GrantUniversalPermissions, int)
103-
104101
IPC_SYNC_MESSAGE_ROUTED0_1(ShellViewHostMsg_AllocateId, int)
105102

src/api/dispatcher_host.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ bool DispatcherHost::OnMessageReceived(const IPC::Message& message) {
107107
OnUncaughtException);
108108
IPC_MESSAGE_HANDLER(ShellViewHostMsg_GetShellId, OnGetShellId);
109109
IPC_MESSAGE_HANDLER(ShellViewHostMsg_CreateShell, OnCreateShell);
110-
IPC_MESSAGE_HANDLER(ShellViewHostMsg_GrantUniversalPermissions, OnGrantUniversalPermissions);
111110
IPC_MESSAGE_HANDLER(ShellViewHostMsg_AllocateId, OnAllocateId);
112111
IPC_MESSAGE_UNHANDLED(handled = false)
113112
IPC_END_MESSAGE_MAP()
@@ -278,16 +277,6 @@ void DispatcherHost::OnCreateShell(const std::string& url,
278277
}
279278
}
280279

281-
void DispatcherHost::OnGrantUniversalPermissions(int *ret) {
282-
content::Shell* shell =
283-
content::Shell::FromRenderViewHost(render_view_host());
284-
if (shell->nodejs()) {
285-
content::ChildProcessSecurityPolicy::GetInstance()->GrantUniversalAccess(shell->web_contents()->GetRenderProcessHost()->GetID());
286-
*ret = 1;
287-
}else
288-
*ret = 0;
289-
}
290-
291280
void DispatcherHost::OnAllocateId(int * ret) {
292281
*ret = AllocateId();
293282
}

src/api/dispatcher_host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class DispatcherHost : public content::RenderViewHostObserver {
105105
void OnCreateShell(const std::string& url,
106106
const base::DictionaryValue& manifest,
107107
int* routing_id);
108-
void OnGrantUniversalPermissions(int* ret);
109108
void OnAllocateId(int* ret);
110109
DISALLOW_COPY_AND_ASSIGN(DispatcherHost);
111110
};

src/renderer/shell_content_renderer_client.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "base/strings/stringprintf.h"
3333
#include "base/strings/utf_string_conversions.h"
3434
#include "components/autofill/content/renderer/page_click_tracker.h"
35+
#include "content/common/view_messages.h"
3536
#include "content/nw/src/api/dispatcher.h"
3637
#include "content/nw/src/api/api_messages.h"
3738
#include "content/nw/src/api/window_bindings.h"
@@ -230,9 +231,9 @@ bool ShellContentRendererClient::WillSetSecurityToken(
230231
context->SetSecurityToken(node::g_context->GetSecurityToken());
231232
frame->document().securityOrigin().grantUniversalAccess();
232233

233-
int ret;
234+
int ret = 0;
234235
RenderViewImpl* rv = RenderViewImpl::FromWebView(frame->view());
235-
rv->Send(new ShellViewHostMsg_GrantUniversalPermissions(rv->GetRoutingID(), &ret));
236+
rv->Send(new ViewHostMsg_GrantUniversalPermissions(rv->GetRoutingID(), &ret));
236237

237238
return true;
238239
}

0 commit comments

Comments
 (0)