• 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 frameCount = 0;
9 // Make sure that underscore-insertion doesn't get too confused by acronyms.
10 static int variableMentioningHTTPAndHTTPS = 1;
11 // g_ prefix, but doesn't follow Google style.
12 int g_withBlinkNaming;
13 // Already Google style, should not change.
14 int g_already_google_style_;
15 
16 // Function parameters
function(int interestingNumber)17 int function(int interestingNumber) {
18   // Local variables.
19   int aLocalVariable = 1;
20   // Static locals.
21   static int aStaticLocalVariable = 2;
22   // Make sure references to variables are also rewritten.
23   return frameCount +
24          variableMentioningHTTPAndHTTPS * interestingNumber / aLocalVariable %
25              aStaticLocalVariable;
26 }
27 
28 }  // namespace blink
29 
30 using blink::frameCount;
31 
F()32 int F() {
33   // Make sure variables qualified with a namespace name are still rewritten
34   // correctly.
35   return frameCount + blink::frameCount;
36 }
37