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

Bridge NS and CFStream as well as make CF components use Ebr function…#1137

Merged
bbowman merged 5 commits into
microsoft:developfrom
bbowman:bbowman/bridgeStream_pr
Oct 13, 2016
Merged

Bridge NS and CFStream as well as make CF components use Ebr function…#1137
bbowman merged 5 commits into
microsoft:developfrom
bbowman:bbowman/bridgeStream_pr

Conversation

@bbowman

@bbowman bbowman commented Oct 13, 2016

Copy link
Copy Markdown
Member

…s for interoperabilty. This is a prestep to unify the file handling mechanics through stream and data instead of direct reliance on Ebr functions.

@bbowman

bbowman commented Oct 13, 2016

Copy link
Copy Markdown
Member Author

@ms-jihua is added to the review. #Closed

@bbowman

bbowman commented Oct 13, 2016

Copy link
Copy Markdown
Member Author

@rajsesh-msft is added to the review. #Closed

ret->st_size = 0;
ret->st_mode = 0x1B6 | 0040000;
// MurmurHash3_x86_32(assetName, strlen(assetName), 0, &ret->st_ino);
return 0;

@DHowett-MSFT DHowett-MSFT Oct 13, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No point in keeping commented code #Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We were faking inodes for .. some .. reason?


In reply to: 83125758 [](ancestors = 83125758)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have no clue. This was a mostly copied version to support 64i32 versions of things. but sure I'll remove commented out line in both.


In reply to: 83125777 [](ancestors = 83125777,83125758)

@bbowman

bbowman commented Oct 13, 2016

Copy link
Copy Markdown
Member Author

#1099
extend fopen to look for things in Windows.Storage.AccessCache is what this works towards. The basic steps are:

  1. Bridge use of CF/NSStream
  2. Consolidate Ebr usage across repo to use Stream
  3. Enhance underlying support for storage file.

#define fstat _NS_fstat
#define mkdir(a,b) _NS_mkdir(a)
#define rmdir _NS_rmdir
#define unlink _NS_unlink

@DHowett-MSFT DHowett-MSFT Oct 13, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It worries me that these are scatted across so many files, but I see that that is a la mode #WontFix

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree but I thought putting these in a commonly included header would be a bit much as I don't really want to #def something like open unless I'm pretty sure its only used in a file sense. some other terms there are pretty common words so I felt a little better about it and it is obviously the system CF is already expecting so yes. Worrisome but the best of a bad situation?


In reply to: 83126012 [](ancestors = 83126012)


char path[CFMaxPathSize];
#if DEPLOYMENT_TARGET_WINDOWS
wchar_t path[CFMaxPathSize];

@DHowett-MSFT DHowett-MSFT Oct 13, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

wchar_t path[CFMaxPathSize]; [](start = 4, length = 28)

Does this change need a WINOBJC comment? #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it could but its not a change needed specifically for us as the normal impl of _NS_open calls _wopen. It was just to have better code reuse but will comment anyway.


In reply to: 83126093 [](ancestors = 83126093)

#import <CFFoundationInternal.h>

#import <StubReturn.h>

@DHowett-MSFT DHowett-MSFT Oct 13, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unused iiuc #Resolved

#import <CoreFoundation/CFStream.h>
#import <CFFoundationInternal.h>

#import <StubReturn.h>

@DHowett-MSFT DHowett-MSFT Oct 13, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

StubReturn [](start = 9, length = 10)

as before #Resolved

}

/**
@Status Stub

@MSFTFox MSFTFox Oct 13, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stub [](start = 9, length = 4)

Not a stub? #Resolved

Comment thread Frameworks/Starboard/AssetFile.cpp Outdated
return -1;
}

char* assetName = fixedName + 1;

@MSFTFox MSFTFox Oct 13, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

assetName [](start = 10, length = 9)

Unused. Unused above as well in a similar function. #Resolved

if (ensureFilesWithContents(fileNames, contents))

{
return fileNames[0];

@rajsesh rajsesh Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: clang format run amok? #Resolved

@rajsesh

rajsesh commented Oct 13, 2016

Copy link
Copy Markdown
Contributor

:shipit:

#define lseek _NS_lseek
#else
#define statinfo _stat
#define stat(x,y) _stat64i32(x,y)

@ms-jihua ms-jihua Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this comment stay there? #ByDesign

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no. Every other file had it as _stat64i32 so that is almost assuredly the right thing.


In reply to: 83308434 [](ancestors = 83308434)

/**
@Status Interoperable
*/
- (id)initWithData:(id)data {

@ms-jihua ms-jihua Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: can you fix the signatures here? #Resolved

/**
@Status Interoperable
*/
- (int)read:(uint8_t*)buf maxLength:(NSUInteger)maxLength {

@ms-jihua ms-jihua Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

int [](start = 3, length = 3)

nit: NSInteger #Resolved

/**
@Status Interoperable
*/
- (unsigned)streamStatus {

@ms-jihua ms-jihua Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unsigned [](start = 3, length = 8)

nit: NSStreamStatus (in nscfoutputstream also) #Resolved

/**
@Status Interoperable
*/
+ (id)inputStreamWithFileAtPath:(id)file {

@ms-jihua ms-jihua Oct 13, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

signatures etc etc. not sure whether you'll fix in the NSCF files but I think they should be correct in the NS files at least. #Resolved

Comment thread Frameworks/Foundation/NSStream.mm Outdated

#include <CoreFoundation/CFStream.h>

FOUNDATION_EXPORT NSString* const NSStreamSocketSecurityLevelKey = @"NSStreamSocketSecurityLevelKey";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the rest of these ought to have CF equivalents also?

@ms-jihua

Copy link
Copy Markdown
Contributor

:shipit:

…s for interoperabilty. This is a prestep to unify the file handling mechanics through stream and data instead of direct reliance on Ebr functions.
@bbowman bbowman force-pushed the bbowman/bridgeStream_pr branch from a7771cb to 0520688 Compare October 13, 2016 23:11
@bbowman bbowman merged commit ef0ec9d into microsoft:develop Oct 13, 2016
aballway pushed a commit to aballway/WinObjC that referenced this pull request Oct 19, 2016
microsoft#1137)

Bridge NS and CFStream as well as make CF components use Ebr functions for interoperabilty. 

Description:

Bridge NS and CFStream as well as make CF components use Ebr functions for interoperabilty. This is a prestep to unify the file handling mechanics through stream and data instead of direct reliance on Ebr functions. 

Works towards microsoft#1099
extend fopen to look for things in Windows.Storage.AccessCache is what this works towards. The basic steps are:
1. Bridge use of CF/NSStream
2. Consolidate Ebr usage across repo to use Stream
3. Enhance underlying support for storage file.

How verified: New UTs and old UTs

Reviewed-by: rajseh-msft, ms-jihua
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants