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

Unified Diff: chrome/test/base/scoped_command_line_override.cc

Issue 8429023: Add platform_app flag to manifest. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge conflict resolution. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/scoped_command_line_override.cc
diff --git a/chrome/test/base/scoped_command_line_override.cc b/chrome/test/base/scoped_command_line_override.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bd4cb30a2ccb8f32aad22be81e42eda94a695957
--- /dev/null
+++ b/chrome/test/base/scoped_command_line_override.cc
@@ -0,0 +1,15 @@
+// Copyright (c) 2011 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 "chrome/test/base/scoped_command_line_override.h"
+
+ScopedCommandLineOverride::ScopedCommandLineOverride(
+ const std::string& new_switch)
+ : old_command_line_(*CommandLine::ForCurrentProcess()) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(new_switch);
+}
+
+ScopedCommandLineOverride::~ScopedCommandLineOverride() {
+ *CommandLine::ForCurrentProcess() = old_command_line_;
+}

Powered by Google App Engine
This is Rietveld 408576698