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

Side by Side Diff: webkit/glue/webkitclient_impl.cc

Issue 6955006: Revert 84486 - Merge gpu_trace_event back into base/debug/trace_event.Initial land attempt at htt... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/tools/test_shell/test_shell_main.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/glue/webkitclient_impl.h" 5 #include "webkit/glue/webkitclient_impl.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <malloc.h> 8 #include <malloc.h>
9 #endif 9 #endif
10 10
11 #include <math.h> 11 #include <math.h>
12 12
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/debug/trace_event.h" 15 #include "base/debug/trace_event.h"
16 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
17 #include "base/message_loop.h" 17 #include "base/message_loop.h"
18 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
19 #include "base/metrics/stats_counters.h" 19 #include "base/metrics/stats_counters.h"
20 #include "base/platform_file.h" 20 #include "base/platform_file.h"
21 #include "base/process_util.h" 21 #include "base/process_util.h"
22 #include "base/rand_util.h" 22 #include "base/rand_util.h"
23 #include "base/string_number_conversions.h" 23 #include "base/string_number_conversions.h"
24 #include "base/string_util.h" 24 #include "base/string_util.h"
25 #include "base/synchronization/lock.h" 25 #include "base/synchronization/lock.h"
26 #include "base/time.h" 26 #include "base/time.h"
27 #include "base/utf_string_conversions.h" 27 #include "base/utf_string_conversions.h"
28 #include "gpu/common/gpu_trace_event.h"
28 #include "grit/webkit_chromium_resources.h" 29 #include "grit/webkit_chromium_resources.h"
29 #include "grit/webkit_resources.h" 30 #include "grit/webkit_resources.h"
30 #include "grit/webkit_strings.h" 31 #include "grit/webkit_strings.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCookie.h" 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCookie.h"
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginListBuilder. h" 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginListBuilder. h"
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // the histogram because name is dynamic. 277 // the histogram because name is dynamic.
277 base::Histogram* counter = 278 base::Histogram* counter =
278 base::LinearHistogram::FactoryGet(name, 1, boundary_value, 279 base::LinearHistogram::FactoryGet(name, 1, boundary_value,
279 boundary_value + 1, base::Histogram::kUmaTargetedHistogramFlag); 280 boundary_value + 1, base::Histogram::kUmaTargetedHistogramFlag);
280 DCHECK_EQ(name, counter->histogram_name()); 281 DCHECK_EQ(name, counter->histogram_name());
281 counter->Add(sample); 282 counter->Add(sample);
282 } 283 }
283 284
284 void WebKitClientImpl::traceEventBegin(const char* name, void* id, 285 void WebKitClientImpl::traceEventBegin(const char* name, void* id,
285 const char* extra) { 286 const char* extra) {
286 TRACE_EVENT_BEGIN_ETW(name, id, extra); 287 TRACE_EVENT_BEGIN(name, id, extra);
288 GPU_TRACE_EVENT_BEGIN2("webkit", name,
289 "id", id,
290 "extra", extra ? extra : "");
287 } 291 }
288 292
289 void WebKitClientImpl::traceEventEnd(const char* name, void* id, 293 void WebKitClientImpl::traceEventEnd(const char* name, void* id,
290 const char* extra) { 294 const char* extra) {
291 TRACE_EVENT_END_ETW(name, id, extra); 295 TRACE_EVENT_END(name, id, extra);
296 GPU_TRACE_EVENT_END0("webkit", name);
292 } 297 }
293 298
294 namespace { 299 namespace {
295 300
296 WebData loadAudioSpatializationResource(const char* name) { 301 WebData loadAudioSpatializationResource(const char* name) {
297 #ifdef IDR_AUDIO_SPATIALIZATION_T000_P000 302 #ifdef IDR_AUDIO_SPATIALIZATION_T000_P000
298 const size_t kExpectedSpatializationNameLength = 31; 303 const size_t kExpectedSpatializationNameLength = 31;
299 if (strlen(name) != kExpectedSpatializationNameLength) { 304 if (strlen(name) != kExpectedSpatializationNameLength) {
300 return WebData(); 305 return WebData();
301 } 306 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 ++shared_timer_suspended_; 590 ++shared_timer_suspended_;
586 } 591 }
587 592
588 void WebKitClientImpl::ResumeSharedTimer() { 593 void WebKitClientImpl::ResumeSharedTimer() {
589 // The shared timer may have fired or been adjusted while we were suspended. 594 // The shared timer may have fired or been adjusted while we were suspended.
590 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) 595 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning())
591 setSharedTimerFireTime(shared_timer_fire_time_); 596 setSharedTimerFireTime(shared_timer_fire_time_);
592 } 597 }
593 598
594 } // namespace webkit_glue 599 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/tools/test_shell/test_shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698