Index: chrome/browser/safe_browsing/client_side_detection_service.cc |
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc |
index 5b2da22e5b0ca8cd46ff5e3f07a315ba08b763d4..0c29e3ebf183072e0d74d23dabbe98d0cd53d651 100644 |
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc |
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc |
@@ -10,7 +10,6 @@ |
#include "base/logging.h" |
#include "base/message_loop.h" |
#include "base/platform_file.h" |
-#include "base/ref_counted_memory.h" |
#include "base/scoped_ptr.h" |
#include "base/stl_util-inl.h" |
#include "base/task.h" |
@@ -19,11 +18,9 @@ |
#include "chrome/common/net/http_return.h" |
#include "chrome/common/net/url_fetcher.h" |
#include "chrome/common/net/url_request_context_getter.h" |
-#include "gfx/codec/png_codec.h" |
#include "googleurl/src/gurl.h" |
#include "net/base/load_flags.h" |
#include "net/url_request/url_request_status.h" |
-#include "third_party/skia/include/core/SkBitmap.h" |
namespace safe_browsing { |
@@ -92,14 +89,13 @@ void ClientSideDetectionService::GetModelFile(OpenModelDoneCallback* callback) { |
void ClientSideDetectionService::SendClientReportPhishingRequest( |
const GURL& phishing_url, |
double score, |
- SkBitmap thumbnail, |
ClientReportPhishingRequestCallback* callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
MessageLoop::current()->PostTask( |
FROM_HERE, |
method_factory_.NewRunnableMethod( |
&ClientSideDetectionService::StartClientReportPhishingRequest, |
- phishing_url, score, thumbnail, callback)); |
+ phishing_url, score, callback)); |
} |
void ClientSideDetectionService::OnURLFetchComplete( |
@@ -226,26 +222,13 @@ void ClientSideDetectionService::StartGetModelFile( |
void ClientSideDetectionService::StartClientReportPhishingRequest( |
const GURL& phishing_url, |
double score, |
- SkBitmap thumbnail, |
ClientReportPhishingRequestCallback* callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
scoped_ptr<ClientReportPhishingRequestCallback> cb(callback); |
- // The server expects an encoded PNG image. |
- scoped_refptr<RefCountedBytes> thumbnail_data(new RefCountedBytes); |
- SkAutoLockPixels lock(thumbnail); |
- if (!thumbnail.readyToDraw() || |
- !gfx::PNGCodec::EncodeBGRASkBitmap(thumbnail, |
- true /* discard_transparency */, |
- &thumbnail_data->data)) { |
- cb->Run(phishing_url, false); |
- return; |
- } |
ClientPhishingRequest request; |
request.set_url(phishing_url.spec()); |
request.set_client_score(static_cast<float>(score)); |
- request.set_snapshot(reinterpret_cast<const char*>(thumbnail_data->front()), |
- thumbnail_data->size()); |
std::string request_data; |
if (!request.SerializeToString(&request_data)) { |
// For consistency, we always call the callback asynchronously, rather than |