summaryrefslogtreecommitdiff
path: root/chromium/tools/gn/pool.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-01 12:59:39 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-04 12:40:43 +0000
commit28b1110370900897ab652cb420c371fab8857ad4 (patch)
tree41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/tools/gn/pool.cc
parent399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff)
downloadqtwebengine-chromium-28b1110370900897ab652cb420c371fab8857ad4.tar.gz
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions. Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/tools/gn/pool.cc')
-rw-r--r--chromium/tools/gn/pool.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/chromium/tools/gn/pool.cc b/chromium/tools/gn/pool.cc
new file mode 100644
index 00000000000..e4fc2062f19
--- /dev/null
+++ b/chromium/tools/gn/pool.cc
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tools/gn/pool.h"
+
+#include <sstream>
+
+#include "base/logging.h"
+
+Pool::Pool(const Settings* settings, const Label& label)
+ : Item(settings, label) {}
+
+Pool::~Pool() {}
+
+Pool* Pool::AsPool() {
+ return this;
+}
+
+const Pool* Pool::AsPool() const {
+ return this;
+}
+
+std::string Pool::GetNinjaName(const Label& default_toolchain) const {
+ bool include_toolchain = label().toolchain_dir() != default_toolchain.dir() ||
+ label().toolchain_name() != default_toolchain.name();
+ return GetNinjaName(include_toolchain);
+}
+
+std::string Pool::GetNinjaName(bool include_toolchain) const {
+ std::ostringstream buffer;
+ if (include_toolchain) {
+ DCHECK(label().toolchain_dir().is_source_absolute());
+ std::string toolchain_dir = label().toolchain_dir().value();
+ for (std::string::size_type i = 2; i < toolchain_dir.size(); ++i) {
+ buffer << (toolchain_dir[i] == '/' ? '_' : toolchain_dir[i]);
+ }
+ buffer << label().toolchain_name() << "_";
+ }
+
+ DCHECK(label().dir().is_source_absolute());
+ std::string label_dir = label().dir().value();
+ for (std::string::size_type i = 2; i < label_dir.size(); ++i) {
+ buffer << (label_dir[i] == '/' ? '_' : label_dir[i]);
+ }
+ buffer << label().name();
+ return buffer.str();
+}