Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d3458d2f
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d3458d2f
编写于
6月 11, 2020
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace duplicate mac id
上级
0ae60c45
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
30 deletion
+10
-30
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+10
-21
src/vs/platform/telemetry/common/telemetry.ts
src/vs/platform/telemetry/common/telemetry.ts
+0
-1
src/vs/platform/telemetry/common/telemetryService.ts
src/vs/platform/telemetry/common/telemetryService.ts
+0
-8
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
d3458d2f
...
...
@@ -26,7 +26,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IURLService
}
from
'
vs/platform/url/common/url
'
;
import
{
URLHandlerChannelClient
,
URLHandlerRouter
}
from
'
vs/platform/url/common/urlIpc
'
;
import
{
ITelemetryService
,
machineIdKey
,
trueMachineIdKey
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
,
machineIdKey
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
NullTelemetryService
,
combinedAppender
,
LogAppender
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
TelemetryAppenderClient
}
from
'
vs/platform/telemetry/node/telemetryIpc
'
;
import
{
TelemetryService
,
ITelemetryServiceConfig
}
from
'
vs/platform/telemetry/common/telemetryService
'
;
...
...
@@ -365,8 +365,8 @@ export class CodeApplication extends Disposable {
// Resolve unique machine ID
this
.
logService
.
trace
(
'
Resolving machine identifier...
'
);
const
{
machineId
,
trueMachineId
}
=
await
this
.
resolveMachineId
();
this
.
logService
.
trace
(
`Resolved machine identifier:
${
machineId
}
(trueMachineId:
${
trueMachineId
}
)
`
);
const
machineId
=
await
this
.
resolveMachineId
();
this
.
logService
.
trace
(
`Resolved machine identifier:
${
machineId
}
`
);
// Spawn shared process after the first window has opened and 3s have passed
const
sharedProcess
=
this
.
instantiationService
.
createInstance
(
SharedProcess
,
machineId
,
this
.
userEnv
);
...
...
@@ -387,7 +387,7 @@ export class CodeApplication extends Disposable {
});
// Services
const
appInstantiationService
=
await
this
.
createServices
(
machineId
,
trueMachineId
,
sharedProcess
,
sharedProcessReady
);
const
appInstantiationService
=
await
this
.
createServices
(
machineId
,
sharedProcess
,
sharedProcessReady
);
// Create driver
if
(
this
.
environmentService
.
driverHandle
)
{
...
...
@@ -412,32 +412,21 @@ export class CodeApplication extends Disposable {
}
}
private
async
resolveMachineId
():
Promise
<
{
machineId
:
string
,
trueMachineId
?:
string
}
>
{
private
async
resolveMachineId
():
Promise
<
string
>
{
// We cache the machineId for faster lookups on startup
// and resolve it only once initially if not cached
// and resolve it only once initially if not cached
or we need to replace the macOS iBridge device
let
machineId
=
this
.
stateService
.
getItem
<
string
>
(
machineIdKey
);
if
(
!
machineId
)
{
if
(
!
machineId
||
(
isMacintosh
&&
machineId
===
'
6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead
'
)
)
{
machineId
=
await
getMachineId
();
this
.
stateService
.
setItem
(
machineIdKey
,
machineId
);
}
// Check if machineId is hashed iBridge Device
let
trueMachineId
:
string
|
undefined
;
if
(
isMacintosh
&&
machineId
===
'
6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead
'
)
{
trueMachineId
=
this
.
stateService
.
getItem
<
string
>
(
trueMachineIdKey
);
if
(
!
trueMachineId
)
{
trueMachineId
=
await
getMachineId
();
this
.
stateService
.
setItem
(
trueMachineIdKey
,
trueMachineId
);
}
}
return
{
machineId
,
trueMachineId
};
return
machineId
;
}
private
async
createServices
(
machineId
:
string
,
trueMachineId
:
string
|
undefined
,
sharedProcess
:
SharedProcess
,
sharedProcessReady
:
Promise
<
Client
<
string
>>
):
Promise
<
IInstantiationService
>
{
private
async
createServices
(
machineId
:
string
,
sharedProcess
:
SharedProcess
,
sharedProcessReady
:
Promise
<
Client
<
string
>>
):
Promise
<
IInstantiationService
>
{
const
services
=
new
ServiceCollection
();
switch
(
process
.
platform
)
{
...
...
@@ -489,7 +478,7 @@ export class CodeApplication extends Disposable {
const
appender
=
combinedAppender
(
new
TelemetryAppenderClient
(
channel
),
new
LogAppender
(
this
.
logService
));
const
commonProperties
=
resolveCommonProperties
(
product
.
commit
,
product
.
version
,
machineId
,
product
.
msftInternalDomains
,
this
.
environmentService
.
installSourcePath
);
const
piiPaths
=
this
.
environmentService
.
extensionsPath
?
[
this
.
environmentService
.
appRoot
,
this
.
environmentService
.
extensionsPath
]
:
[
this
.
environmentService
.
appRoot
];
const
config
:
ITelemetryServiceConfig
=
{
appender
,
commonProperties
,
piiPaths
,
trueMachineId
,
sendErrorTelemetry
:
true
};
const
config
:
ITelemetryServiceConfig
=
{
appender
,
commonProperties
,
piiPaths
,
sendErrorTelemetry
:
true
};
services
.
set
(
ITelemetryService
,
new
SyncDescriptor
(
TelemetryService
,
[
config
]));
}
else
{
...
...
src/vs/platform/telemetry/common/telemetry.ts
浏览文件 @
d3458d2f
...
...
@@ -55,5 +55,4 @@ export const currentSessionDateStorageKey = 'telemetry.currentSessionDate';
export
const
firstSessionDateStorageKey
=
'
telemetry.firstSessionDate
'
;
export
const
lastSessionDateStorageKey
=
'
telemetry.lastSessionDate
'
;
export
const
machineIdKey
=
'
telemetry.machineId
'
;
export
const
trueMachineIdKey
=
'
telemetry.trueMachineId
'
;
export
const
crashReporterIdStorageKey
=
'
crashReporter.guid
'
;
src/vs/platform/telemetry/common/telemetryService.ts
浏览文件 @
d3458d2f
...
...
@@ -20,7 +20,6 @@ export interface ITelemetryServiceConfig {
sendErrorTelemetry
?:
boolean
;
commonProperties
?:
Promise
<
{
[
name
:
string
]:
any
}
>
;
piiPaths
?:
string
[];
trueMachineId
?:
string
;
}
export
class
TelemetryService
implements
ITelemetryService
{
...
...
@@ -76,13 +75,6 @@ export class TelemetryService implements ITelemetryService {
usingFallbackGuid
:
{
classification
:
'
SystemMetaData
'
,
purpose
:
'
BusinessInsight
'
,
isMeasurement
:
true
};
};
this
.
publicLog2
<
{
usingFallbackGuid
:
boolean
},
MachineIdFallbackClassification
>
(
'
machineIdFallback
'
,
{
usingFallbackGuid
:
!
isHashedId
});
if
(
config
.
trueMachineId
)
{
type
MachineIdDisambiguationClassification
=
{
correctedMachineId
:
{
endPoint
:
'
MacAddressHash
'
,
classification
:
'
EndUserPseudonymizedInformation
'
,
purpose
:
'
FeatureInsight
'
};
};
this
.
publicLog2
<
{
correctedMachineId
:
string
},
MachineIdDisambiguationClassification
>
(
'
machineIdDisambiguation
'
,
{
correctedMachineId
:
config
.
trueMachineId
});
}
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录