Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jason-simmons
Copy link
Member

@jason-simmons
Copy link
Member Author

@chinmaygarde @aam

return stream.str();
}

std::string SanitizeURIEscapedCharacters(const std::string& str) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel that this function is a nice candidate for a unit test which both helps ensure correctness, and helps the reader understand what the function is doing. Do we have unit tests for fml yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

return uri;

std::string file_path = uri.substr(kFileURLPrefixLength);
std::replace(file_path.begin(), file_path.end(), '/', '\\');
Copy link
Member

Choose a reason for hiding this comment

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

msvc complains:

ninja -t msvc -e environment.x64 -- C:\src\goma/gomacc.exe "C:\src\depot_tools\win_toolchain\vs_files\9bc7ccbf9f4bd50d4a3bd185e8ca94ff1618de0b\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64/cl.exe" /nologo /showIncludes /FC @obj/flutter/fml/platform/win/fml.paths_win.obj.rsp /c ../../flutter/fml/platform/win/paths_win.cc /Foobj/flutter/fml/platform/win/fml.paths_win.obj /Fdobj/flutter/fml/fml_cc.pdb
c:\src\flutter\engine\src\flutter\fml\platform\win\paths_win.cc(88): error C2039: 'replace': is not a member of 'std'
c:\src\depot_tools\win_toolchain\vs_files\9bc7ccbf9f4bd50d4a3bd185e8ca94ff1618de0b\vc\tools\msvc\14.11.25503\include\string(15): note: see declaration of 'std'
c:\src\flutter\engine\src\flutter\fml\platform\win\paths_win.cc(88): error C3861: 'replace': identifier not found

Copy link
Member

Choose a reason for hiding this comment

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

string::replace / std::replace_copy?

Copy link
Member Author

Choose a reason for hiding this comment

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

added #include <algorithm>


namespace {

const char kFileURLPrefix[] = "file://";
Copy link
Member

Choose a reason for hiding this comment

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

Here and below: not that it matters in the context, but I imagine this could be constexpr.

Copy link
Member 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

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

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

LGTM

@aam
Copy link
Member

aam commented Sep 6, 2018

Thanks!

@aam
Copy link
Member

aam commented Sep 6, 2018

Should be able to land change to flutter tools to switch to uris:

diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart
index 51bc7fae6..688982e64 100644
--- a/packages/flutter_tools/lib/src/vmservice.dart
+++ b/packages/flutter_tools/lib/src/vmservice.dart
@@ -932,8 +932,8 @@ class VM extends ServiceObjectOwner {
     return invokeRpc<ServiceMap>('_flutter.runInView',
       params: <String, dynamic> {
         'viewId': viewId,
-        'mainScript': main.toFilePath(windows: false),
-        'packagesFile': packages.toFilePath(windows: false),
+        'mainScript': main.toString(),
+        'packagesFile': packages.toString(),
         'assetDirectory': assetsDirectory.toFilePath(windows: false)
     });
   }

@jason-simmons jason-simmons merged commit 85d47fb into flutter:master Sep 7, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...85d47fb

git log 58a1894..85d47fb --no-merges --oneline
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...687cf08

git log 58a1894..687cf08 --no-merges --oneline
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...2af72eb

git log 58a1894..2af72eb --no-merges --oneline
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...16c56af

git log 58a1894..16c56af --no-merges --oneline
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...93dac2a

git log 58a1894..93dac2a --no-merges --oneline
93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199)
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 7, 2018
flutter/engine@58a1894...e27a2e9

git log 58a1894..e27a2e9 --no-merges --oneline
e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201)
93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199)
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2018
flutter/engine@58a1894...bf96dbe

git log 58a1894..bf96dbe --no-merges --oneline
bf96dbe Revert &#34;Some cleanups enabled by removing support for Dart. (flutter#5621)&#34; (flutter/engine#6205)
3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203)
4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621)
e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201)
93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199)
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2018
flutter/engine@58a1894...b952331

git log 58a1894..b952331 --no-merges --oneline
b952331 Allow embedders to specify a custom GL proc address resolver. (flutter/engine#6204)
bf96dbe Revert &#34;Some cleanups enabled by removing support for Dart. (flutter#5621)&#34; (flutter/engine#6205)
3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203)
4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621)
e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201)
93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199)
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2018
flutter/engine@58a1894...bf3c224

git log 58a1894..bf3c224 --no-merges --oneline
bf3c224 Roll src/third_party/skia 2810c856dfa2..a3dc329d1db1 (1 commits) (flutter/engine#6206)
b952331 Allow embedders to specify a custom GL proc address resolver. (flutter/engine#6204)
bf96dbe Revert &#34;Some cleanups enabled by removing support for Dart. (flutter#5621)&#34; (flutter/engine#6205)
3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203)
4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621)
e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201)
93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199)
16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200)
2af72eb Don&#39;t map iOS reduce motion to disabled animations (flutter/engine#6194)
687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176)
85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191)
5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198)
f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197)
75f6bdf Revert &#34;Dart SDK roll for 2018/09/06 (flutter#6189)&#34; (flutter/engine#6192)
b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193)
e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150)
f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants