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

Side by Side Diff: extensions/browser/api/test/test_api.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/test/test_api.h" 5 #include "extensions/browser/api/test/test_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 TestConfigState* test_config_state = TestConfigState::GetInstance(); 104 TestConfigState* test_config_state = TestConfigState::GetInstance();
105 test_config_state->set_config_state(value); 105 test_config_state->set_config_state(value);
106 } 106 }
107 107
108 TestGetConfigFunction::TestConfigState::TestConfigState() 108 TestGetConfigFunction::TestConfigState::TestConfigState()
109 : config_state_(NULL) {} 109 : config_state_(NULL) {}
110 110
111 // static 111 // static
112 TestGetConfigFunction::TestConfigState* 112 TestGetConfigFunction::TestConfigState*
113 TestGetConfigFunction::TestConfigState::GetInstance() { 113 TestGetConfigFunction::TestConfigState::GetInstance() {
114 return Singleton<TestConfigState>::get(); 114 return base::Singleton<TestConfigState>::get();
115 } 115 }
116 116
117 TestGetConfigFunction::~TestGetConfigFunction() {} 117 TestGetConfigFunction::~TestGetConfigFunction() {}
118 118
119 bool TestGetConfigFunction::RunSafe() { 119 bool TestGetConfigFunction::RunSafe() {
120 TestConfigState* test_config_state = TestConfigState::GetInstance(); 120 TestConfigState* test_config_state = TestConfigState::GetInstance();
121 121
122 if (!test_config_state->config_state()) { 122 if (!test_config_state->config_state()) {
123 error_ = kNoTestConfigDataError; 123 error_ = kNoTestConfigDataError;
124 return false; 124 return false;
125 } 125 }
126 126
127 SetResult(test_config_state->config_state()->DeepCopy()); 127 SetResult(test_config_state->config_state()->DeepCopy());
128 return true; 128 return true;
129 } 129 }
130 130
131 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} 131 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {}
132 132
133 bool TestWaitForRoundTripFunction::RunSafe() { 133 bool TestWaitForRoundTripFunction::RunSafe() {
134 scoped_ptr<WaitForRoundTrip::Params> params( 134 scoped_ptr<WaitForRoundTrip::Params> params(
135 WaitForRoundTrip::Params::Create(*args_)); 135 WaitForRoundTrip::Params::Create(*args_));
136 SetResult(new base::StringValue(params->message)); 136 SetResult(new base::StringValue(params->message));
137 return true; 137 return true;
138 } 138 }
139 139
140 } // namespace extensions 140 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/test/test_api.h ('k') | extensions/browser/api/vpn_provider/vpn_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698