summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis <thakis@chromium.org>2015-07-29 11:49:31 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-29 18:50:01 +0000
commit7723a54779134f260c625a39ca852a99f91ad35d (patch)
treefd01f7c5ba474f323d34a8f89950394665ba7001
parent3170eedded69e295d126b75457e586306fce0c5b (diff)
downloadchromium_src-7723a54779134f260c625a39ca852a99f91ad35d.zip
chromium_src-7723a54779134f260c625a39ca852a99f91ad35d.tar.gz
chromium_src-7723a54779134f260c625a39ca852a99f91ad35d.tar.bz2
clang/win: Fix two more -Wundefined-function warnings in Chromium code.
The upgrade_detector_impl.cc change fixes a minor oversight in https://codereview.chromium.org/1255073002 The atl_module.h change makes the function inline instead of static. C++ guarantees that local statics in an inline function are the same object, but this isn't important for this function -- in fact, simplify the body of the function too to just call the constructor directly instead of using both CR_DEFINE_STATIC_LOCAL and ALLOW_UNUSED_LOCAL (this part is behavior-preserving). I think the static->inline change has a minor behavior difference in that if the function ends up not being inlined, previously every TU in the same dll that doesn't inline it would get its own copy of this function, while now they all share one copy (per dll). BUG=505316 Review URL: https://codereview.chromium.org/1269533002 Cr-Commit-Position: refs/heads/master@{#340933}
-rw-r--r--chrome/browser/upgrade_detector_impl.cc2
-rw-r--r--ui/base/win/atl_module.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc
index 2f03dbe..4e783aa 100644
--- a/chrome/browser/upgrade_detector_impl.cc
+++ b/chrome/browser/upgrade_detector_impl.cc
@@ -90,6 +90,7 @@ int GetCheckForUpgradeEveryMs() {
return kCheckForUpgradeMs;
}
+#if !defined(OS_WIN)
// Return true if the current build is one of the unstable channels.
bool IsUnstableChannel() {
// TODO(mad): Investigate whether we still need to be on the file thread for
@@ -102,7 +103,6 @@ bool IsUnstableChannel() {
channel == chrome::VersionInfo::CHANNEL_CANARY;
}
-#if !defined(OS_WIN)
// This task identifies whether we are running an unstable version. And then it
// unconditionally calls back the provided task.
void CheckForUnstableChannel(const base::Closure& callback_task,
diff --git a/ui/base/win/atl_module.h b/ui/base/win/atl_module.h
index 8b69697..f677b43 100644
--- a/ui/base/win/atl_module.h
+++ b/ui/base/win/atl_module.h
@@ -26,11 +26,10 @@ namespace win {
// This function must be implemented in this header file rather than a
// source file so that it's inlined into the module where it's included,
// rather than in the "ui" module.
-static void CreateATLModuleIfNeeded() {
+inline void CreateATLModuleIfNeeded() {
if (_pAtlModule == NULL) {
// This creates the module and automatically updates _pAtlModule.
- CR_DEFINE_STATIC_LOCAL(CComModule, module, ());
- ALLOW_UNUSED_LOCAL(module);
+ new CComModule;
}
}