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

Side by Side Diff: chrome/common/net/notifier/base/utils.h

Issue 1956001: Moved XMPP notifier library from chrome/browser/sync to chrome/common.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // Utility functions. 5 // Utility functions.
6 6
7 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_UTILS_H_ 7 #ifndef CHROME_COMMON_NET_NOTIFIER_BASE_UTILS_H_
8 #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_UTILS_H_ 8 #define CHROME_COMMON_NET_NOTIFIER_BASE_UTILS_H_
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "chrome/browser/sync/notifier/base/static_assert.h" 13 #include "chrome/common/net/notifier/base/static_assert.h"
14 14
15 // Return error if the first argument evaluates to false. 15 // Return error if the first argument evaluates to false.
16 #define RET_IF_FALSE(x) do { if (!(x)) return false; } while (false) 16 #define RET_IF_FALSE(x) do { if (!(x)) return false; } while (false)
17 17
18 // Protocol constants. 18 // Protocol constants.
19 const char kHttpProto[] = "http://"; 19 const char kHttpProto[] = "http://";
20 const char kHttpsProto[] = "https://"; 20 const char kHttpsProto[] = "https://";
21 21
22 // Initialize a POD to zero. Using this function requires discipline. Don't 22 // Initialize a POD to zero. Using this function requires discipline. Don't
23 // use for types that have a v-table or virtual bases. 23 // use for types that have a v-table or virtual bases.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void GetMapElement(const std::map<const std::string, const T>& m, 80 void GetMapElement(const std::map<const std::string, const T>& m,
81 const char* name, 81 const char* name,
82 T* value) { 82 T* value) {
83 typename std::map<const std::string, const T>::const_iterator iter( 83 typename std::map<const std::string, const T>::const_iterator iter(
84 m.find(name)); 84 m.find(name));
85 if (iter != m.end()) { 85 if (iter != m.end()) {
86 *value = iter->second; 86 *value = iter->second;
87 } 87 }
88 } 88 }
89 89
90 #endif // CHROME_BROWSER_SYNC_NOTIFIER_BASE_UTILS_H_ 90 #endif // CHROME_COMMON_NET_NOTIFIER_BASE_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/common/net/notifier/base/timer.cc ('k') | chrome/common/net/notifier/base/win/async_network_alive_win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698