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

Side by Side Diff: extensions/common/user_script.cc

Issue 1543053002: Switch to standard integer types in extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@int-extensions-browser
Patch Set: Created 4 years, 12 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 | « extensions/common/user_script.h ('k') | extensions/common/user_script_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/common/user_script.h" 5 #include "extensions/common/user_script.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
8 #include "base/command_line.h" 11 #include "base/command_line.h"
9 #include "base/pickle.h" 12 #include "base/pickle.h"
10 #include "base/strings/pattern.h" 13 #include "base/strings/pattern.h"
11 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
12 #include "extensions/common/switches.h" 15 #include "extensions/common/switches.h"
13 16
14 namespace { 17 namespace {
15 18
16 // This cannot be a plain int or int64 because we need to generate unique IDs 19 // This cannot be a plain int or int64_t because we need to generate unique IDs
17 // from multiple threads. 20 // from multiple threads.
18 base::StaticAtomicSequenceNumber g_user_script_id_generator; 21 base::StaticAtomicSequenceNumber g_user_script_id_generator;
19 22
20 bool UrlMatchesGlobs(const std::vector<std::string>* globs, 23 bool UrlMatchesGlobs(const std::vector<std::string>* globs,
21 const GURL& url) { 24 const GURL& url) {
22 for (std::vector<std::string>::const_iterator glob = globs->begin(); 25 for (std::vector<std::string>::const_iterator glob = globs->begin();
23 glob != globs->end(); ++glob) { 26 glob != globs->end(); ++glob) {
24 if (base::MatchPattern(url.spec(), *glob)) 27 if (base::MatchPattern(url.spec(), *glob))
25 return true; 28 return true;
26 } 29 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 285 }
283 286
284 bool operator<(const UserScript& script1, const UserScript& script2) { 287 bool operator<(const UserScript& script1, const UserScript& script2) {
285 // The only kind of script that should be compared is the kind that has its 288 // The only kind of script that should be compared is the kind that has its
286 // IDs initialized to a meaningful value. 289 // IDs initialized to a meaningful value.
287 DCHECK(script1.id() != -1 && script2.id() != -1); 290 DCHECK(script1.id() != -1 && script2.id() != -1);
288 return script1.id() < script2.id(); 291 return script1.id() < script2.id();
289 } 292 }
290 293
291 } // namespace extensions 294 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/user_script.h ('k') | extensions/common/user_script_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698