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

Side by Side Diff: src/libplatform/tracing/tracing-controller.cc

Issue 2912773002: Rename "NoBarrier" memory operations to "Relaxed". (Closed)
Patch Set: comment Created 3 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 unified diff | Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/libsampler/sampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "include/libplatform/v8-tracing.h" 8 #include "include/libplatform/v8-tracing.h"
9 9
10 #include "src/base/platform/mutex.h" 10 #include "src/base/platform/mutex.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // to guarantee that metadata events are always added even if the category 137 // to guarantee that metadata events are always added even if the category
138 // filter is "-*". See crbug.com/618054 for more details and long-term fix. 138 // filter is "-*". See crbug.com/618054 for more details and long-term fix.
139 if (mode_ == RECORDING_MODE && !strcmp(category_group, "__metadata")) { 139 if (mode_ == RECORDING_MODE && !strcmp(category_group, "__metadata")) {
140 enabled_flag |= ENABLED_FOR_RECORDING; 140 enabled_flag |= ENABLED_FOR_RECORDING;
141 } 141 }
142 142
143 g_category_group_enabled[category_index] = enabled_flag; 143 g_category_group_enabled[category_index] = enabled_flag;
144 } 144 }
145 145
146 void TracingController::UpdateCategoryGroupEnabledFlags() { 146 void TracingController::UpdateCategoryGroupEnabledFlags() {
147 size_t category_index = base::NoBarrier_Load(&g_category_index); 147 size_t category_index = base::Relaxed_Load(&g_category_index);
148 for (size_t i = 0; i < category_index; i++) UpdateCategoryGroupEnabledFlag(i); 148 for (size_t i = 0; i < category_index; i++) UpdateCategoryGroupEnabledFlag(i);
149 } 149 }
150 150
151 const uint8_t* TracingController::GetCategoryGroupEnabledInternal( 151 const uint8_t* TracingController::GetCategoryGroupEnabledInternal(
152 const char* category_group) { 152 const char* category_group) {
153 // Check that category groups does not contain double quote 153 // Check that category groups does not contain double quote
154 DCHECK(!strchr(category_group, '"')); 154 DCHECK(!strchr(category_group, '"'));
155 155
156 // The g_category_groups is append only, avoid using a lock for the fast path. 156 // The g_category_groups is append only, avoid using a lock for the fast path.
157 size_t current_category_index = v8::base::Acquire_Load(&g_category_index); 157 size_t current_category_index = v8::base::Acquire_Load(&g_category_index);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void TracingController::RemoveTraceStateObserver( 209 void TracingController::RemoveTraceStateObserver(
210 Platform::TraceStateObserver* observer) { 210 Platform::TraceStateObserver* observer) {
211 base::LockGuard<base::Mutex> lock(mutex_.get()); 211 base::LockGuard<base::Mutex> lock(mutex_.get());
212 DCHECK(observers_.find(observer) != observers_.end()); 212 DCHECK(observers_.find(observer) != observers_.end());
213 observers_.erase(observer); 213 observers_.erase(observer);
214 } 214 }
215 215
216 } // namespace tracing 216 } // namespace tracing
217 } // namespace platform 217 } // namespace platform
218 } // namespace v8 218 } // namespace v8
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/libsampler/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698