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

Side by Side Diff: chrome/browser/android/webapk/webapk_icon_hasher.cc

Issue 2477173002: Make WebAPK server use Murmur2 Hash version compatible with WebAPK server (Closed)
Patch Set: Merge branch 'master' into murmur2 Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/android/webapk/webapk_icon_hasher.h" 5 #include "chrome/browser/android/webapk/webapk_icon_hasher.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "net/http/http_status_code.h" 9 #include "net/http/http_status_code.h"
10 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
(...skipping 29 matching lines...) Expand all
40 callback_.Run(""); 40 callback_.Run("");
41 return; 41 return;
42 } 42 }
43 43
44 // WARNING: We are running in the browser process. |raw_image_data| is the 44 // WARNING: We are running in the browser process. |raw_image_data| is the
45 // image's raw, unsanitized bytes from the web. |raw_image_data| may contain 45 // image's raw, unsanitized bytes from the web. |raw_image_data| may contain
46 // malicious data. Decoding unsanitized bitmap data to an SkBitmap in the 46 // malicious data. Decoding unsanitized bitmap data to an SkBitmap in the
47 // browser process is a security bug. 47 // browser process is a security bug.
48 std::string raw_image_data; 48 std::string raw_image_data;
49 source->GetResponseAsString(&raw_image_data); 49 source->GetResponseAsString(&raw_image_data);
50 uint64_t hash = MurmurHash64B(&raw_image_data.front(), raw_image_data.size(), 50 uint64_t hash = MurmurHash64A(&raw_image_data.front(), raw_image_data.size(),
51 kMurmur2HashSeed); 51 kMurmur2HashSeed);
52 callback_.Run(base::Uint64ToString(hash)); 52 callback_.Run(base::Uint64ToString(hash));
53 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698