• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 namespace blink {
6 
7 // Global variables
8 int g_frame_count = 0;
9 // Make sure that underscore-insertion doesn't get too confused by acronyms.
10 static int g_variable_mentioning_http_and_https = 1;
11 // g_ prefix, but doesn't follow Google style.
12 int g_with_blink_naming;
13 // Already Google style, should not change.
14 int g_already_google_style_;
15 
16 // Function parameters
Function(int interesting_number)17 int Function(int interesting_number) {
18   // Local variables.
19   int a_local_variable = 1;
20   // Static locals.
21   static int a_static_local_variable = 2;
22   // Make sure references to variables are also rewritten.
23   return g_frame_count +
24          g_variable_mentioning_http_and_https * interesting_number /
25              a_local_variable % a_static_local_variable;
26 }
27 
28 }  // namespace blink
29 
30 using blink::g_frame_count;
31 
F()32 int F() {
33   // Make sure variables qualified with a namespace name are still rewritten
34   // correctly.
35   return g_frame_count + blink::g_frame_count;
36 }
37