Skip to content
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

Merged
merged 1 commit into from Aug 16, 2018

Conversation

aslushnikov
Copy link
Contributor

This patch:

  • merges ElementHandle into ExecutionContext (for simplicity; there's no good reason to have them in separate files).
  • removes the necessity to pass handle factory when creating ExecutionContext

This makes it easier to create execution contexts out of payloads.

package.json Outdated
@@ -8,7 +8,7 @@
"node": ">=6.4.0"
},
"puppeteer": {
"chromium_revision": "579032"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what

Copy link
Contributor Author

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);
Copy link
Collaborator

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');
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

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

@aslushnikov aslushnikov merged commit d6eb3b4 into puppeteer:master Aug 16, 2018
aslushnikov added a commit that referenced this pull request Aug 17, 2018
@aslushnikov aslushnikov deleted the worlds-1 branch August 24, 2018 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants