Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 6288156869525504: Issue #276 - eliminate CString from GetDataPath (Closed)

Created:
July 30, 2014, 8:03 p.m. by Eric
Modified:
Aug. 5, 2014, 5:35 p.m.
Visibility:
Public.

Description

Issue #276 - eliminate CString from GetDataPath Change the return type and arguments of GetDataPath from CString to std::wstring. Removed CString from its implementation. Moved GetDataPath from a static member of CPluginSettings to a standalone function. Removed some directly-related occurrences of CString from CPluginDebug::Debug and CPluginDebug::DebugClear.

Patch Set 1 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -20 lines) Patch
M src/plugin/PluginDebug.cpp View 5 chunks +13 lines, -15 lines 0 comments Download
M src/plugin/PluginSettings.h View 2 chunks +1 line, -2 lines 2 comments Download
M src/plugin/PluginSettings.cpp View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 5
Eric
July 30, 2014, 8:06 p.m. (2014-07-30 20:06:32 UTC) #1
Oleksandr
http://codereview.adblockplus.org/6288156869525504/diff/5741031244955648/src/plugin/PluginSettings.h File src/plugin/PluginSettings.h (right): http://codereview.adblockplus.org/6288156869525504/diff/5741031244955648/src/plugin/PluginSettings.h#newcode116 src/plugin/PluginSettings.h:116: std::wstring GetDataPath(const std::wstring& filename=L""); If it's not a member ...
Aug. 5, 2014, 12:06 p.m. (2014-08-05 12:06:08 UTC) #2
sergei
LGTM
Aug. 5, 2014, 12:12 p.m. (2014-08-05 12:12:11 UTC) #3
Eric
Oleksandr, if you've got no objections to deferring moving code between files, I'll push this. ...
Aug. 5, 2014, 3:42 p.m. (2014-08-05 15:42:06 UTC) #4
Oleksandr
Aug. 5, 2014, 4:53 p.m. (2014-08-05 16:53:46 UTC) #5
ok. LGTM
On 2014/08/05 15:42:06, Eric wrote:
> Oleksandr, if you've got no objections to deferring moving code between files,
> I'll push this.
> 
>
http://codereview.adblockplus.org/6288156869525504/diff/5741031244955648/src/...
> File src/plugin/PluginSettings.h (right):
> 
>
http://codereview.adblockplus.org/6288156869525504/diff/5741031244955648/src/...
> src/plugin/PluginSettings.h:116: std::wstring GetDataPath(const std::wstring&
> filename=L"");
> On 2014/08/05 12:06:08, Oleksandr wrote:
> > If it's not a member of a class I'd move it elsewhere (Utils maybe?).
> 
> There are a bunch of static functions like this that don't need to be static.
> They're not really utilities but rather more application-specific. They might
> better go elsewhere, I agree, but it can also go in a separate change set,
> similar to GetBrowserLanguage(), orphaned with the removal of CPluginSystem.
> 
> > But I
> > really don't mind having it as a static method. Even though it's not using
any
> > static variables. 
> 
> It used to be in C++ that you'd use static class methods as a substitute for a
> namespace. These days we have explicit namespaces, which is what I'd recommend
> here.
> 
> The function in question is about the installation context of the plugin.
Since
> installation tends to act like global variables, with all their attendant
> issues, it's usually a good idea to mark its occurrences somehow.
> 
> We can make all these decisions later, though, both what file to put the code
it
> and what namespace to use.

Powered by Google App Engine
This is Rietveld