New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: drop jshandle factory from ExecutionContext #3099
Conversation
package.json
Outdated
@@ -8,7 +8,7 @@ | |||
"node": ">=6.4.0" | |||
}, | |||
"puppeteer": { | |||
"chromium_revision": "579032" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebaselined.
@@ -33,7 +33,7 @@ class Worker extends EventEmitter { | |||
let jsHandleFactory; | |||
this._client.once('Runtime.executionContextCreated', async event => { | |||
jsHandleFactory = remoteObject => new JSHandle(executionContext, client, remoteObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove jsHandleFactory
@@ -27,6 +27,7 @@ const Tracing = require('./Tracing'); | |||
const {helper, debugError, assert} = require('./helper'); | |||
const {Coverage} = require('./Coverage'); | |||
const {Worker} = require('./Worker'); | |||
const {createJSHandle} = require('./ExecutionContext'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSHandleFromProtocol
* @param {!Puppeteer.CDPSession} client | ||
* @param {?Frame} parentFrame | ||
* @param {string} frameId | ||
*/ | ||
constructor(client, parentFrame, frameId) { | ||
constructor(frameManager, client, parentFrame, frameId) { | ||
this._frameManager = frameManager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done; we need framemanager in element handle to resolve content frames
This reverts commit d6eb3b4.
This patch:
ElementHandle
intoExecutionContext
(for simplicity; there's no good reason to have them in separate files).ExecutionContext
This makes it easier to create execution contexts out of payloads.