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

Unified Diff: rlz/lib/financial_ping.cc

Issue 327783003: Speculatively use memory barriers for loading and storing g_context, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/lib/financial_ping.cc
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
index a5990a2b1270ad8151d95d6216d915ac3989aeda..da710e1ab62572643aad016cae4f261e3661f3a0 100644
--- a/rlz/lib/financial_ping.cc
+++ b/rlz/lib/financial_ping.cc
@@ -188,7 +188,7 @@ AtomicWord g_context;
bool FinancialPing::SetURLRequestContext(
net::URLRequestContextGetter* context) {
- base::subtle::NoBarrier_Store(
+ base::subtle::Release_Store(
&g_context, reinterpret_cast<AtomicWord>(context));
return true;
}
@@ -218,7 +218,7 @@ bool send_financial_ping_interrupted_for_test = false;
void ShutdownCheck(base::WeakPtr<base::RunLoop> weak) {
if (!weak.get())
return;
- if (!base::subtle::NoBarrier_Load(&g_context)) {
+ if (!base::subtle::Acquire_Load(&g_context)) {
send_financial_ping_interrupted_for_test = true;
weak->QuitClosure().Run();
return;
@@ -295,7 +295,7 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
// the method is running.
net::URLRequestContextGetter* context =
reinterpret_cast<net::URLRequestContextGetter*>(
- base::subtle::NoBarrier_Load(&g_context));
+ base::subtle::Acquire_Load(&g_context));
// Browser shutdown will cause the context to be reset to NULL.
if (!context)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698