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

Side by Side Diff: third_party/protobuf/src/google/protobuf/compiler/importer.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years 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
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // backslashes are standard. Let's avoid confusion and use only forward 263 // backslashes are standard. Let's avoid confusion and use only forward
264 // slashes. 264 // slashes.
265 if (HasPrefixString(path, "\\\\")) { 265 if (HasPrefixString(path, "\\\\")) {
266 // Avoid converting two leading backslashes. 266 // Avoid converting two leading backslashes.
267 path = "\\\\" + StringReplace(path.substr(2), "\\", "/", true); 267 path = "\\\\" + StringReplace(path.substr(2), "\\", "/", true);
268 } else { 268 } else {
269 path = StringReplace(path, "\\", "/", true); 269 path = StringReplace(path, "\\", "/", true);
270 } 270 }
271 #endif 271 #endif
272 272
273 vector<string> canonical_parts; 273 std::vector<string> canonical_parts;
274 vector<string> parts = Split( 274 std::vector<string> parts = Split(
275 path, "/", true); // Note: Removes empty parts. 275 path, "/", true); // Note: Removes empty parts.
276 for (int i = 0; i < parts.size(); i++) { 276 for (int i = 0; i < parts.size(); i++) {
277 if (parts[i] == ".") { 277 if (parts[i] == ".") {
278 // Ignore. 278 // Ignore.
279 } else { 279 } else {
280 canonical_parts.push_back(parts[i]); 280 canonical_parts.push_back(parts[i]);
281 } 281 }
282 } 282 }
283 string result = Join(canonical_parts, "/"); 283 string result = Join(canonical_parts, "/");
284 if (!path.empty() && path[0] == '/') { 284 if (!path.empty() && path[0] == '/') {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 result->SetCloseOnDelete(true); 487 result->SetCloseOnDelete(true);
488 return result; 488 return result;
489 } else { 489 } else {
490 return NULL; 490 return NULL;
491 } 491 }
492 } 492 }
493 493
494 } // namespace compiler 494 } // namespace compiler
495 } // namespace protobuf 495 } // namespace protobuf
496 } // namespace google 496 } // namespace google
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698