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

Side by Side Diff: content/browser/speech/google_streaming_remote_engine.cc

Issue 218953003: Remove all uses of GG_LONGLONG and GG_ULONGLONG. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win? Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/speech/google_streaming_remote_engine.h" 5 #include "content/browser/speech/google_streaming_remote_engine.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 langs = accepted_language_list.substr(0, separator); 556 langs = accepted_language_list.substr(0, separator);
557 } 557 }
558 } 558 }
559 if (langs.empty()) 559 if (langs.empty())
560 langs = "en-US"; 560 langs = "en-US";
561 return langs; 561 return langs;
562 } 562 }
563 563
564 // TODO(primiano): Is there any utility in the codebase that already does this? 564 // TODO(primiano): Is there any utility in the codebase that already does this?
565 std::string GoogleStreamingRemoteEngine::GenerateRequestKey() const { 565 std::string GoogleStreamingRemoteEngine::GenerateRequestKey() const {
566 const int64 kKeepLowBytes = GG_LONGLONG(0x00000000FFFFFFFF); 566 const int64 kKeepLowBytes = 0x00000000FFFFFFFFLL;
567 const int64 kKeepHighBytes = GG_LONGLONG(0xFFFFFFFF00000000); 567 const int64 kKeepHighBytes = 0xFFFFFFFF00000000LL;
568 568
569 // Just keep the least significant bits of timestamp, in order to reduce 569 // Just keep the least significant bits of timestamp, in order to reduce
570 // probability of collisions. 570 // probability of collisions.
571 int64 key = (base::Time::Now().ToInternalValue() & kKeepLowBytes) | 571 int64 key = (base::Time::Now().ToInternalValue() & kKeepLowBytes) |
572 (base::RandUint64() & kKeepHighBytes); 572 (base::RandUint64() & kKeepHighBytes);
573 return base::HexEncode(reinterpret_cast<void*>(&key), sizeof(key)); 573 return base::HexEncode(reinterpret_cast<void*>(&key), sizeof(key));
574 } 574 }
575 575
576 GoogleStreamingRemoteEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value) 576 GoogleStreamingRemoteEngine::FSMEventArgs::FSMEventArgs(FSMEvent event_value)
577 : event(event_value) { 577 : event(event_value) {
578 } 578 }
579 579
580 GoogleStreamingRemoteEngine::FSMEventArgs::~FSMEventArgs() { 580 GoogleStreamingRemoteEngine::FSMEventArgs::~FSMEventArgs() {
581 } 581 }
582 582
583 } // namespace content 583 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_store_file.cc ('k') | google_apis/drive/gdata_wapi_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698