Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRefactor FileAPI implementation #12406
Conversation
highfive
commented
Jul 12, 2016
|
Heads up! This PR modifies the following files:
|
|
Overall LGTM -- could you add doc comments on all the structs and sprinkled throughout the codebase? The fact that BlobBuf can be a seek'd slice too is a bit non-obvious. |
|
Good, I will have a double-check |
|
Done |
| refs: AtomicUsize, | ||
| /// UUID key's validity as Blob URL | ||
| /// Validity of the UUID key being part of a valid Blob URL |
This comment has been minimized.
This comment has been minimized.
Manishearth
Jul 12, 2016
Member
Better phrased: "UUIDs only become valid blob URIs when explicitly requested by the user with createObjectURI. Validity can be revoked as well."
| } | ||
| } | ||
| } | ||
|
|
||
| /// File manager's data store. It maintains a thread-safe mapping | ||
| /// from FileID to FileStoreEntry which might have different backend implementation. | ||
| /// Access to the content is sealed as methods of this struct. |
This comment has been minimized.
This comment has been minimized.
|
r=me, minor nits |
|
Fixed |
|
@bors-servo r+ |
|
|
Refactor FileAPI implementation Most are simple refactoring, cleanups and improvements, but still involving two slightly notable changes: + In `filemanager`, now we read the file content based on requested `RelativePos` by `seek` and `read_exact` (rather than `read_to_end` then do slicing). This strategy might be again adjusted in future performance tuning but certainly better than nothing. + Also, I cached more file meta-info in both sides and left a block of comment on `filemanager`'s file reading mentioning the snapshot-state problem (not solved now though). r? @Manishearth <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12406) <!-- Reviewable:end -->
|
|
|
@Manishearth Sorry, I made a mistake in making |
|
Yep, just noticed that @bors-servo r- delegate+ |
|
|
|
@bors-servo r=Manishearth |
|
|
Refactor FileAPI implementation Most are simple refactoring, cleanups and improvements, but still involving two slightly notable changes: + In `filemanager`, now we read the file content based on requested `RelativePos` by `seek` and `read_exact` (rather than `read_to_end` then do slicing). This strategy might be again adjusted in future performance tuning but certainly better than nothing. + Also, I cached more file meta-info in both sides and left a block of comment on `filemanager`'s file reading mentioning the snapshot-state problem (not solved now though). r? @Manishearth <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12406) <!-- Reviewable:end -->
|
|
izgzhen commentedJul 12, 2016
•
edited
Most are simple refactoring, cleanups and improvements, but still involving two slightly notable changes:
filemanager, now we read the file content based on requestedRelativePosbyseekandread_exact(rather thanread_to_endthen do slicing). This strategy might be again adjusted in future performance tuning but certainly better than nothing.filemanager's file reading mentioning the snapshot-state problem (not solved now though).r? @Manishearth
Part of #11131
This change is