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

Side by Side Diff: chrome/common/content_settings_helper.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/child_process_logging_posix.cc ('k') | chrome/common/content_settings_pattern.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/content_settings_helper.h" 5 #include "chrome/common/content_settings_helper.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 11
12 namespace content_settings_helper { 12 namespace content_settings_helper {
13 13
14 std::string OriginToString(const GURL& origin) { 14 std::string OriginToString(const GURL& origin) {
15 std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED ? 15 std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED
16 ":" + origin.port() : ""); 16 ? ":" + origin.port()
17 std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) ? 17 : std::string());
18 origin.scheme() + content::kStandardSchemeSeparator : ""); 18 std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme)
19 return scheme_component + origin.host() + port_component; 19 ? origin.scheme() +
20 content::kStandardSchemeSeparator
21 : std::string());
22 return scheme_component + origin.host() + port_component;
20 } 23 }
21 24
22 string16 OriginToString16(const GURL& origin) { 25 string16 OriginToString16(const GURL& origin) {
23 return UTF8ToUTF16(OriginToString(origin)); 26 return UTF8ToUTF16(OriginToString(origin));
24 } 27 }
25 28
26 } // namespace content_settings_helper 29 } // namespace content_settings_helper
OLDNEW
« no previous file with comments | « chrome/common/child_process_logging_posix.cc ('k') | chrome/common/content_settings_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698