Skip to content

Conversation

@alan-knight
Copy link
Contributor

Sorry for the size, this has several different things in it

  • add variables in dartFramesFor (the important part)
  • add a single test for that
  • operate better without a connection, so we can write unit tests more easily
  • provide fake implementations of WipConnection, AppInspector, and Runtime for tests
  • make AppInspector extend Domain and use checkIsolate
  • add a library for WebKit mirror objects not yet in wip_inspection_protocol (Property)
  • add an example with more complicated scopes than the hello world example. Mostly used for manual testing so far, though I did extract hard-coded test data from it.


/// A constructor for the AppInspector to call which doesn't set
/// [_appInspectorProvider] as it's not used by the AppInspector.
Domain.forInspector();
Copy link
Member

Choose a reason for hiding this comment

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

I don't follow this. Why is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Domain takes an AppInspectorProvider. The AppInspectorProvider has to return the instance. When we're in the constructor for AppInspector we can't reference this, so we can't call super with an AppInspectorProvider. The only workaround I found was to give it a constructor that didn't need that.

case 'object':
// TODO: Actual toString()
var toString = 'Placeholder for toString() result';
var truncated = toString.substring(0, math.min(100, toString.length));
Copy link
Member

Choose a reason for hiding this comment

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

Curious where this 100 value is coming from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's completely arbitrary. Added a TODO to make that consistent with what the VM does.

/// A library for WebKit mirror objects and support code. These probably should
/// get migrated into webkit_inspection_protocol over time.
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
Copy link
Member

Choose a reason for hiding this comment

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

Can we not depend on this package for this abstraction? This will become problematic as we make use of the Chrome Debug Extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It needs that now because it can return RemoteObject from that package for its values. My thought was more to fold this into that package than to re-implement what it does.

Why is it problematic if we use the extension? Is the extension going to use an incompatible protocol?

Copy link
Member

Choose a reason for hiding this comment

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

Discussed offline. We'll likely reuse the abstractions provided by webkit_inspection_protocol but change out the actual communication layer.

@alan-knight alan-knight requested a review from jakemac53 July 9, 2019 23:13
@alan-knight alan-knight requested a review from grouma July 10, 2019 19:32
@alan-knight alan-knight merged commit 7aad2b5 into master Jul 10, 2019
@alan-knight alan-knight deleted the variables branch July 10, 2019 20:03
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.

2 participants