Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Issue 2426053002: Fix crashes on debug windows (Closed)

Created:
4 years, 2 months ago by zra
Modified:
4 years, 2 months ago
Reviewers:
rmacnak, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Add comment #

Patch Set 3 : Cleanup #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -2 lines) Patch
M runtime/bin/extensions_win.cc View 1 chunk +10 lines, -1 line 0 comments Download
M runtime/bin/file.h View 1 2 1 chunk +4 lines, -0 lines 1 comment Download
M runtime/bin/file_win.cc View 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 6 (2 generated)
zra
4 years, 2 months ago (2016-10-18 16:28:25 UTC) #2
zra
TBR
4 years, 2 months ago (2016-10-18 16:36:48 UTC) #3
zra
Committed patchset #3 (id:40001) manually as df260e5fe7e0d4e42624e68dc752b5742202764f (presubmit successful).
4 years, 2 months ago (2016-10-18 16:37:10 UTC) #5
siva
4 years, 2 months ago (2016-10-18 17:32:20 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2426053002/diff/40001/runtime/bin/file.h
File runtime/bin/file.h (right):

https://codereview.chromium.org/2426053002/diff/40001/runtime/bin/file.h#newc...
runtime/bin/file.h:167: // without a scope, they will fail on Windows!
GetType is in this list but it does not call Dart_ScopeAllocate after this CL,
maybe it should be moved out of the list?

I suppose Dart_ScopeAllocate was being used in order to make the
deletion of the allocated wide char string easy. 
It is useful to be able to call these file utility functions without
having to set up a Dart Scope. Could we use the C++ destructor
mechanism to achieve the same?

Something like :
File::Type File::GetType(const char* pathname, bool follow_links) {
  MutiByteToWideChar convert(pathname);
  const wchar_t* name = convert.string();
  ...
  ...
  return result;
}

The destructor of MultiByteToWideChar takes care of deleting the allocated
string.

Powered by Google App Engine
This is Rietveld 408576698