fix: use webContentsId with contextId together (#13749)
After after using `processId-contextCounter` as contextId, it may happen that contexts in different WebContents sharing the same renderer process get the same contextId. Using webContentsId as part of key in ObjectsRegistry can fix this.
This commit is contained in:
parent
d7b41462af
commit
3094f62f0b
7 changed files with 26 additions and 53 deletions
|
@ -1,19 +0,0 @@
|
|||
// Copyright (c) 2018 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/common/context_counter.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
int g_context_id = 0;
|
||||
|
||||
} // namespace
|
||||
|
||||
int GetNextContextId() {
|
||||
return ++g_context_id;
|
||||
}
|
||||
|
||||
} // namespace atom
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (c) 2018 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_COMMON_CONTEXT_COUNTER_H_
|
||||
#define ATOM_COMMON_CONTEXT_COUNTER_H_
|
||||
|
||||
namespace atom {
|
||||
|
||||
// Increase the context counter, and return current count.
|
||||
int GetNextContextId();
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_COMMON_CONTEXT_COUNTER_H_
|
Loading…
Add table
Add a link
Reference in a new issue